wut  1.0.0-beta9
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 
29 BOOL
30 OSIsAddressValid(uint32_t virtualAddress);
31 
32 BOOL
33 __OSValidateAddressSpaceRange(int /* unused */,
34  uint32_t virtualAddress,
35  uint32_t size);
36 
57 uint32_t
58 OSAllocVirtAddr(uint32_t virtualAddress,
59  uint32_t size,
60  uint32_t align);
61 
74 BOOL
75 OSFreeVirtAddr(uint32_t virtualAddress,
76  uint32_t size);
77 
89 OSQueryVirtAddr(uint32_t virtualAddress);
90 
114 BOOL
115 OSMapMemory(uint32_t virtualAddress,
116  uint32_t physicalAddress,
117  uint32_t size,
118  OSMemoryMapMode mode);
119 
132 BOOL
133 OSUnmapMemory(uint32_t virtualAddress,
134  uint32_t size);
135 
148 void
149 OSGetMapVirtAddrRange(uint32_t *outVirtualAddress,
150  uint32_t *outSize);
151 
167 void
168 OSGetAvailPhysAddrRange(uint32_t *outPhysicalAddress,
169  uint32_t *outSize);
170 
184 void
185 OSGetDataPhysAddrRange(uint32_t *outPhysicalAddress,
186  uint32_t *outSize);
187 
188 #ifdef __cplusplus
189 }
190 #endif
191 
OS_MAP_MEMORY_READ_ONLY
@ OS_MAP_MEMORY_READ_ONLY
Definition: memorymap.h:18
OS_MAP_MEMORY_INVALID
@ OS_MAP_MEMORY_INVALID
Definition: memorymap.h:17
OSQueryVirtAddr
OSMemoryMapMode OSQueryVirtAddr(uint32_t virtualAddress)
Determines the status of the given virtual memory address - mapped read-write or read-only,...
OS_MAP_MEMORY_FREE
@ OS_MAP_MEMORY_FREE
Definition: memorymap.h:20
OSFreeVirtAddr
BOOL OSFreeVirtAddr(uint32_t virtualAddress, uint32_t size)
Frees a previously allocated virtual address range back to the system.
wut.h
OS_MAP_MEMORY_READ_WRITE
@ OS_MAP_MEMORY_READ_WRITE
Definition: memorymap.h:19
OSMemoryMapMode
OSMemoryMapMode
Definition: memorymap.h:15
OSGetAvailPhysAddrRange
void OSGetAvailPhysAddrRange(uint32_t *outPhysicalAddress, uint32_t *outSize)
Gets the range of available physical memory (not reserved for app code or data).
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.
OSGetDataPhysAddrRange
void OSGetDataPhysAddrRange(uint32_t *outPhysicalAddress, uint32_t *outSize)
Gets the range of physical memory used for the application's data.
OSEffectiveToPhysical
uint32_t OSEffectiveToPhysical(uint32_t virtualAddress)
__OSValidateAddressSpaceRange
BOOL __OSValidateAddressSpaceRange(int, uint32_t virtualAddress, uint32_t size)
OSUnmapMemory
BOOL OSUnmapMemory(uint32_t virtualAddress, uint32_t size)
Unmaps previously mapped memory.
OSIsAddressValid
BOOL OSIsAddressValid(uint32_t virtualAddress)
OS_MAP_MEMORY_ALLOCATED
@ OS_MAP_MEMORY_ALLOCATED
Definition: memorymap.h:21
BOOL
int32_t BOOL
Definition: wut_types.h:4
OSGetMapVirtAddrRange
void OSGetMapVirtAddrRange(uint32_t *outVirtualAddress, uint32_t *outSize)
Gets the range of virtual addresses available for mapping.
OSAllocVirtAddr
uint32_t OSAllocVirtAddr(uint32_t virtualAddress, uint32_t size, uint32_t align)
Allocates virtual address range for later mapping.