libnds
Loading...
Searching...
No Matches
Functions
cache.h File Reference

ARM9 cache control functions. More...

#include <nds/arm9/cp15.h>
#include <nds/ndstypes.h>

Functions

static void DC_FlushAll (void)
 Flush the entire data cache to memory.
 
static void DC_FlushRange (const void *base, u32 size)
 Flush the data cache of a range of addresses to memory.
 
static void DC_InvalidateAll (void)
 Invalidate the entire data cache.
 
static void DC_InvalidateRange (const void *base, u32 size)
 Invalidate the data cache of a range of addresses.
 
static void IC_InvalidateAll (void)
 Invalidate the entire instruction cache.
 
static void IC_InvalidateRange (const void *base, u32 size)
 Invalidate the instruction cache of a range of addresses.
 

Detailed Description

ARM9 cache control functions.

ARM9 cache defines.

Function Documentation

◆ DC_FlushRange()

static void DC_FlushRange ( const void *  base,
u32  size 
)
inlinestatic

Flush the data cache of a range of addresses to memory.

Parameters
baseBase address of the region.
sizeSize of the region.

◆ DC_InvalidateRange()

static void DC_InvalidateRange ( const void *  base,
u32  size 
)
inlinestatic

Invalidate the data cache of a range of addresses.

Warning
In debug builds of libnds, this function checks that the base and end addresses are aligned to a cache line.

It's dangerous to invalidate a memory range. If the memory range isn't fully contained inside cache lines, invalidating it will also invalidate the variables around the range the caller wants to invalidate. This may cause unintended effects.

Parameters
baseBase address of the region to invalidate
sizeSize of the region to invalidate.

◆ IC_InvalidateRange()

static void IC_InvalidateRange ( const void *  base,
u32  size 
)
inlinestatic

Invalidate the instruction cache of a range of addresses.

Parameters
baseBase address of the region.
sizeSize of the region.