KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
sq.h
Go to the documentation of this file.
1 /* KallistiOS ##version##
2 
3  kernel/arch/dreamcast/include/dc/sq.h
4  (C)2000-2001 Andrew Kieschnick
5 
6 */
7 
8 /** \file dc/sq.h
9  \brief Functions to access the SH4 Store Queues.
10 
11  The store queues are a way to do efficient burst transfers from the CPU to
12  external memory. They can be used in a variety of ways, such as to transfer
13  a texture to PVR memory. The transfers are in units of 32-bytes, and the
14  destinations must be 32-byte aligned.
15 
16  \author Andrew Kieschnick
17 */
18 
19 #ifndef __DC_SQ_H
20 #define __DC_SQ_H
21 
22 #include <sys/cdefs.h>
23 __BEGIN_DECLS
24 
25 #include <arch/types.h>
26 
27 /** \brief Store Queue 0 access register */
28 #define QACR0 (*(volatile unsigned int *)(void *)0xff000038)
29 
30 /** \brief Store Queue 1 access register */
31 #define QACR1 (*(volatile unsigned int *)(void *)0xff00003c)
32 
33 /** \brief Clear a block of memory.
34 
35  This function is similar to calling memset() with a value to set of 0, but
36  uses the store queues to do its work.
37 
38  \param dest The address to begin clearing at (32-byte aligned).
39  \param n The number of bytes to clear (multiple of 32).
40 */
41 void sq_clr(void *dest, int n);
42 
43 /** \brief Copy a block of memory.
44 
45  This function is similar to memcpy4(), but uses the store queues to do its
46  work.
47 
48  \param dest The address to copy to (32-byte aligned).
49  \param src The address to copy from (32-bit (4-byte) aligned).
50  \param n The number of bytes to copy (multiple of 32).
51  \return The original value of dest.
52 */
53 void * sq_cpy(void *dest, void *src, int n);
54 
55 /** \brief Set a block of memory to an 8-bit value.
56 
57  This function is similar to calling memset(), but uses the store queues to
58  do its work.
59 
60  \param s The address to begin setting at (32-byte aligned).
61  \param c The value to set (in the low 8-bits).
62  \param n The number of bytes to set (multiple of 32).
63  \return The original value of dest.
64 */
65 void * sq_set(void *s, uint32 c, int n);
66 
67 /** \brief Set a block of memory to a 16-bit value.
68 
69  This function is similar to calling memset2(), but uses the store queues to
70  do its work.
71 
72  \param s The address to begin setting at (32-byte aligned).
73  \param c The value to set (in the low 16-bits).
74  \param n The number of bytes to set (multiple of 32).
75  \return The original value of dest.
76 */
77 void * sq_set16(void *s, uint32 c, int n);
78 
79 /** \brief Set a block of memory to a 32-bit value.
80 
81  This function is similar to calling memset4(), but uses the store queues to
82  do its work.
83 
84  \param s The address to begin setting at (32-byte aligned).
85  \param c The value to set (all 32-bits).
86  \param n The number of bytes to set (multiple of 32).
87  \return The original value of dest.
88 */
89 void * sq_set32(void *s, uint32 c, int n);
90 
91 __END_DECLS
92 
93 #endif
94 
void * sq_set16(void *s, uint32 c, int n)
Set a block of memory to a 16-bit value.
Common integer types.
unsigned long uint32
32-bit unsigned integer
Definition: types.h:28
void * sq_set32(void *s, uint32 c, int n)
Set a block of memory to a 32-bit value.
void sq_clr(void *dest, int n)
Clear a block of memory.
void * sq_set(void *s, uint32 c, int n)
Set a block of memory to an 8-bit value.
void * sq_cpy(void *dest, void *src, int n)
Copy a block of memory.