wut  v1.5.0
Wii U Toolchain
Macros | Typedefs | Enumerations | Functions
Memory Map
Collaboration diagram for Memory Map:

Macros

#define OS_PAGE_SIZE   (128 * 1024)
 

Typedefs

typedef enum OSMemoryMapMode OSMemoryMapMode
 

Enumerations

enum  OSMemoryMapMode {
  OS_MAP_MEMORY_INVALID = 0 ,
  OS_MAP_MEMORY_READ_ONLY = 1 ,
  OS_MAP_MEMORY_READ_WRITE = 2 ,
  OS_MAP_MEMORY_FREE = 3 ,
  OS_MAP_MEMORY_ALLOCATED = 4
}
 

Functions

uint32_t OSEffectiveToPhysical (uint32_t virtualAddress)
 
BOOL OSIsAddressValid (uint32_t virtualAddress)
 
BOOL __OSValidateAddressSpaceRange (int, uint32_t virtualAddress, uint32_t size)
 
uint32_t OSAllocVirtAddr (uint32_t virtualAddress, uint32_t size, uint32_t align)
 Allocates virtual address range for later mapping. More...
 
BOOL OSFreeVirtAddr (uint32_t virtualAddress, uint32_t size)
 Frees a previously allocated virtual address range back to the system. More...
 
OSMemoryMapMode OSQueryVirtAddr (uint32_t virtualAddress)
 Determines the status of the given virtual memory address - mapped read-write or read-only, free, allocated or invalid. More...
 
BOOL OSMapMemory (uint32_t virtualAddress, uint32_t physicalAddress, uint32_t size, OSMemoryMapMode mode)
 Maps a physical address to a virtual address, with a given size and set of permissions. More...
 
BOOL OSUnmapMemory (uint32_t virtualAddress, uint32_t size)
 Unmaps previously mapped memory. More...
 
void OSGetMapVirtAddrRange (uint32_t *outVirtualAddress, uint32_t *outSize)
 Gets the range of virtual addresses available for mapping. More...
 
void OSGetAvailPhysAddrRange (uint32_t *outPhysicalAddress, uint32_t *outSize)
 Gets the range of available physical memory (not reserved for app code or data). More...
 
void OSGetDataPhysAddrRange (uint32_t *outPhysicalAddress, uint32_t *outSize)
 Gets the range of physical memory used for the application's data. More...
 

Detailed Description

Macro Definition Documentation

◆ OS_PAGE_SIZE

#define OS_PAGE_SIZE   (128 * 1024)

Definition at line 24 of file memorymap.h.

Typedef Documentation

◆ OSMemoryMapMode

Enumeration Type Documentation

◆ OSMemoryMapMode

Enumerator
OS_MAP_MEMORY_INVALID 
OS_MAP_MEMORY_READ_ONLY 
OS_MAP_MEMORY_READ_WRITE 
OS_MAP_MEMORY_FREE 
OS_MAP_MEMORY_ALLOCATED 

Definition at line 15 of file memorymap.h.

Function Documentation

◆ OSEffectiveToPhysical()

uint32_t OSEffectiveToPhysical ( uint32_t  virtualAddress)

◆ OSIsAddressValid()

BOOL OSIsAddressValid ( uint32_t  virtualAddress)

◆ __OSValidateAddressSpaceRange()

BOOL __OSValidateAddressSpaceRange ( int  ,
uint32_t  virtualAddress,
uint32_t  size 
)

◆ OSAllocVirtAddr()

uint32_t OSAllocVirtAddr ( uint32_t  virtualAddress,
uint32_t  size,
uint32_t  align 
)

Allocates virtual address range for later mapping.

Parameters
virtualAddressRequested start address for the range. If there is no preference, NULL can be used.
sizeSize of address range to allocate.
alignAlignment of address range to allocate.
Returns
The starting address of the newly allocated range, or NULL on failure.
See also

◆ OSFreeVirtAddr()

BOOL OSFreeVirtAddr ( uint32_t  virtualAddress,
uint32_t  size 
)

Frees a previously allocated virtual address range back to the system.

Parameters
virtualAddressThe start of the virtual address range to free.
sizeThe size of the virtual address range to free.
Returns
true on success.

◆ OSQueryVirtAddr()

OSMemoryMapMode OSQueryVirtAddr ( uint32_t  virtualAddress)

Determines the status of the given virtual memory address - mapped read-write or read-only, free, allocated or invalid.

Parameters
virtualAddressThe virtual address to query.
Returns
The status of the memory address - see OSMemoryMapMode.

◆ OSMapMemory()

BOOL OSMapMemory ( uint32_t  virtualAddress,
uint32_t  physicalAddress,
uint32_t  size,
OSMemoryMapMode  mode 
)

Maps a physical address to a virtual address, with a given size and set of permissions.

Parameters
virtualAddressThe target virtual address for the mapping.
physicalAddressPhysical address of the memory to back the mapping.
sizeSize, in bytes, of the desired mapping. Likely has an alignment requirement.
modePermissions to map the memory with - see OSMemoryMapMode.
Returns
true on success.
See also

◆ OSUnmapMemory()

BOOL OSUnmapMemory ( uint32_t  virtualAddress,
uint32_t  size 
)

Unmaps previously mapped memory.

Parameters
virtualAddressStarting address of the area to unmap.
sizeSize of the memory area to unmap.
Returns
true on success.

◆ OSGetMapVirtAddrRange()

void OSGetMapVirtAddrRange ( uint32_t *  outVirtualAddress,
uint32_t *  outSize 
)

Gets the range of virtual addresses available for mapping.

Parameters
outVirtualAddressPointer to write the starting address of the memory area to.
outSizePointer to write the size of the memory area to.
See also

◆ OSGetAvailPhysAddrRange()

void OSGetAvailPhysAddrRange ( uint32_t *  outPhysicalAddress,
uint32_t *  outSize 
)

Gets the range of available physical memory (not reserved for app code or data).

Parameters
outPhysicalAddressPointer to write the starting physical address of the memory area to.
outSizePointer to write the size of the memory area to.

◆ OSGetDataPhysAddrRange()

void OSGetDataPhysAddrRange ( uint32_t *  outPhysicalAddress,
uint32_t *  outSize 
)

Gets the range of physical memory used for the application's data.

Parameters
outPhysicalAddressPointer to write the starting physical address of the memory area to.
outSizePointer to write the size of the memory area to.