libOGC  1.0
 All Data Structures Files Functions Variables Typedefs Macros Modules Pages
Macros
OS memory casting macros

Macros

#define MEM_K0_TO_K1(x)   (void*)((u32)(x) + (SYS_BASE_UNCACHED - SYS_BASE_CACHED))
 
#define MEM_K0_TO_PHYSICAL(x)   (void*)((u32)(x) - SYS_BASE_CACHED)
 
#define MEM_K1_TO_K0(x)   (void*)((u32)(x) - (SYS_BASE_UNCACHED - SYS_BASE_CACHED))
 
#define MEM_K1_TO_PHYSICAL(x)   (void*)((u32)(x) - SYS_BASE_UNCACHED)
 
#define MEM_PHYSICAL_TO_K0(x)   (void*)((u32)(x) + SYS_BASE_CACHED)
 
#define MEM_PHYSICAL_TO_K1(x)   (void*)((u32)(x) + SYS_BASE_UNCACHED)
 
#define MEM_VIRTUAL_TO_PHYSICAL(x)   (((u32)(x)) & ~SYS_BASE_UNCACHED)
 

Detailed Description

Macro Definition Documentation

#define MEM_K0_TO_K1 (   x)    (void*)((u32)(x) + (SYS_BASE_UNCACHED - SYS_BASE_CACHED))

Cast cached virtual address to uncached virtual address, e.g. 0x8xxxxxxx -> 0xCxxxxxxx

#define MEM_K0_TO_PHYSICAL (   x)    (void*)((u32)(x) - SYS_BASE_CACHED)

Cast physical address to cached virtual address, e.g. 0x0xxxxxxx -> 0x8xxxxxxx

#define MEM_K1_TO_K0 (   x)    (void*)((u32)(x) - (SYS_BASE_UNCACHED - SYS_BASE_CACHED))

Cast uncached virtual address to cached virtual address, e.g. 0xCxxxxxxx -> 0x8xxxxxxx

#define MEM_K1_TO_PHYSICAL (   x)    (void*)((u32)(x) - SYS_BASE_UNCACHED)

Cast physical address to uncached virtual address, e.g. 0x0xxxxxxx -> 0xCxxxxxxx

#define MEM_PHYSICAL_TO_K0 (   x)    (void*)((u32)(x) + SYS_BASE_CACHED)

Cast physical address to cached virtual address, e.g. 0x0xxxxxxx -> 0x8xxxxxxx

#define MEM_PHYSICAL_TO_K1 (   x)    (void*)((u32)(x) + SYS_BASE_UNCACHED)

Cast physical address to uncached virtual address, e.g. 0x0xxxxxxx -> 0xCxxxxxxx

#define MEM_VIRTUAL_TO_PHYSICAL (   x)    (((u32)(x)) & ~SYS_BASE_UNCACHED)

Cast virtual address to physical address, e.g. 0x8xxxxxxx -> 0x0xxxxxxx