MI_CpuClear*

Syntax

#include <nitro/mi.h>

void MI_CpuClear8( void* dest, u32 size);
void MI_CpuClear16( void* dest, u32 size);
void MI_CpuClear32( void* dest, u32 size);
void MI_CpuClearFast( void* dest, u32 size);
void MI_CpuClear( void* dest, u32 size );

Arguments

dest The address of the clear destination
size Clear size

Return Values

None.

Description

This function uses the CPU to zero-clear memory.

MI_CpuClear8() selects the most efficient memory access based on the transfer destination address, and then fills the memory with zeroes in 16-bit and 32-bit units, as appropriate. The alignment of the clear destination address does not need to be considered.

MI_CpuClear16() fills the memory with zeros in 16-bit units. The clear destination address must be 2-byte aligned.

MI_CpuClear32() fills the memory with zeros in 32-bit units. The clear destination address must be 4-byte aligned.

MI_CpuClearFast() fills with zeros at high speed in 32-byte units. The clear destination address must be 4-byte aligned. The clear size must be an integral multiple of 4 bytes. (It does not have to be a multiple of 32.).

MI_CpuClear(), in the same manner as MI_CpuClear8(), selects the most efficient memory access based on the transfer destination address, and fills the memory with 0's in 16-bit and 32-bit units, as appropriate. The alignment of the clear destination address does not need to be considered. If the alignment and clear size are defined, we recommend that you divide calls between MI_CpuClearFast and MI_CpuClear32, as appropriate.

Internal Operation

Processing is done by the CPU only and does not use the DMA controller. It does not use a system call. The MI_CpuClear8 function clears 16 or 32 bits at a time, so accessing VRAM directly will not cause problems.

The MI_CpuClear function clears data in 8-bit units for some target addresses, so it should not be used when accessing VRAM directly. (It can be used in TWL mode if extended VRAM has been configured.)

See Also

MI_CpuCopy*, MI_CpuFill*, MI_CpuSend*, MI_DmaClear*

Revision History

2008/09/01 Added MI_CpuClear.
2005/07/07 Added a description of the clear size for MI_CpuClearFast.
2004/04/29 Added a description of MI_CpuClear8.
2004/03/29 Mentioned that system calls are not used.
2003/12/01 Initial version.


CONFIDENTIAL