KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Macros | Functions
sq.h File Reference

Functions to access the SH4 Store Queues. More...

#include <sys/cdefs.h>
#include <arch/types.h>

Go to the source code of this file.

Macros

#define QACR0   (*(volatile unsigned int *)(void *)0xff000038)
 Store Queue 0 access register. More...
 
#define QACR1   (*(volatile unsigned int *)(void *)0xff00003c)
 Store Queue 1 access register. More...
 

Functions

void sq_clr (void *dest, int n)
 Clear a block of memory. More...
 
void * sq_cpy (void *dest, void *src, int n)
 Copy a block of memory. More...
 
void * sq_set (void *s, uint32 c, int n)
 Set a block of memory to an 8-bit value. More...
 
void * sq_set16 (void *s, uint32 c, int n)
 Set a block of memory to a 16-bit value. More...
 
void * sq_set32 (void *s, uint32 c, int n)
 Set a block of memory to a 32-bit value. More...
 

Detailed Description

Functions to access the SH4 Store Queues.

The store queues are a way to do efficient burst transfers from the CPU to external memory. They can be used in a variety of ways, such as to transfer a texture to PVR memory. The transfers are in units of 32-bytes, and the destinations must be 32-byte aligned.

Author
Andrew Kieschnick

Macro Definition Documentation

#define QACR0   (*(volatile unsigned int *)(void *)0xff000038)

Store Queue 0 access register.

#define QACR1   (*(volatile unsigned int *)(void *)0xff00003c)

Store Queue 1 access register.

Function Documentation

void sq_clr ( void *  dest,
int  n 
)

Clear a block of memory.

This function is similar to calling memset() with a value to set of 0, but uses the store queues to do its work.

Parameters
destThe address to begin clearing at (32-byte aligned).
nThe number of bytes to clear (multiple of 32).
void* sq_cpy ( void *  dest,
void *  src,
int  n 
)

Copy a block of memory.

This function is similar to memcpy4(), but uses the store queues to do its work.

Parameters
destThe address to copy to (32-byte aligned).
srcThe address to copy from (32-bit (4-byte) aligned).
nThe number of bytes to copy (multiple of 32).
Returns
The original value of dest.
void* sq_set ( void *  s,
uint32  c,
int  n 
)

Set a block of memory to an 8-bit value.

This function is similar to calling memset(), but uses the store queues to do its work.

Parameters
sThe address to begin setting at (32-byte aligned).
cThe value to set (in the low 8-bits).
nThe number of bytes to set (multiple of 32).
Returns
The original value of dest.
void* sq_set16 ( void *  s,
uint32  c,
int  n 
)

Set a block of memory to a 16-bit value.

This function is similar to calling memset2(), but uses the store queues to do its work.

Parameters
sThe address to begin setting at (32-byte aligned).
cThe value to set (in the low 16-bits).
nThe number of bytes to set (multiple of 32).
Returns
The original value of dest.
void* sq_set32 ( void *  s,
uint32  c,
int  n 
)

Set a block of memory to a 32-bit value.

This function is similar to calling memset4(), but uses the store queues to do its work.

Parameters
sThe address to begin setting at (32-byte aligned).
cThe value to set (all 32-bits).
nThe number of bytes to set (multiple of 32).
Returns
The original value of dest.