wut  1.0.0-alpha
Wii U Toolchain
memorymap.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 typedef enum OSMemoryMapMode
16 {
23 
24 #define OS_PAGE_SIZE (128 * 1024)
25 
26 uint32_t
27 OSEffectiveToPhysical(uint32_t virtualAddress);
28 
49 uint32_t
50 OSAllocVirtAddr(uint32_t virtualAddress,
51  uint32_t size,
52  uint32_t align);
53 
66 BOOL
67 OSFreeVirtAddr(uint32_t virtualAddress,
68  uint32_t size);
69 
81 OSQueryVirtAddr(uint32_t virtualAddress);
82 
106 BOOL
107 OSMapMemory(uint32_t virtualAddress,
108  uint32_t physicalAddress,
109  uint32_t size,
110  OSMemoryMapMode mode);
111 
124 BOOL
125 OSUnmapMemory(uint32_t virtualAddress,
126  uint32_t size);
127 
140 void
141 OSGetMapVirtAddrRange(uint32_t *outVirtualAddress,
142  uint32_t *outSize);
143 
159 void
160 OSGetAvailPhysAddrRange(uint32_t *outPhysicalAddress,
161  uint32_t *outSize);
162 
176 void
177 OSGetDataPhysAddrRange(uint32_t *outPhysicalAddress,
178  uint32_t *outSize);
179 
180 #ifdef __cplusplus
181 }
182 #endif
OSMemoryMapMode
Definition: memorymap.h:15
BOOL OSUnmapMemory(uint32_t virtualAddress, uint32_t size)
Unmaps previously mapped memory.
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.
uint32_t OSAllocVirtAddr(uint32_t virtualAddress, uint32_t size, uint32_t align)
Allocates virtual address range for later mapping.
void OSGetMapVirtAddrRange(uint32_t *outVirtualAddress, uint32_t *outSize)
Gets the range of virtual addresses available for mapping.
OSMemoryMapMode OSQueryVirtAddr(uint32_t virtualAddress)
Determines the status of the given virtual memory address - mapped read-write or read-only, free, allocated or invalid.
int32_t BOOL
Definition: wut_types.h:4
void OSGetDataPhysAddrRange(uint32_t *outPhysicalAddress, uint32_t *outSize)
Gets the range of physical memory used for the application&#39;s data.
void OSGetAvailPhysAddrRange(uint32_t *outPhysicalAddress, uint32_t *outSize)
Gets the range of available physical memory (not reserved for app code or data).
BOOL OSFreeVirtAddr(uint32_t virtualAddress, uint32_t size)
Frees a previously allocated virtual address range back to the system.
uint32_t OSEffectiveToPhysical(uint32_t virtualAddress)