wut  v1.7.0
Wii U Toolchain
memory.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 OSMemoryType
16 {
17  OS_MEM1 = 1,
18  OS_MEM2 = 2,
20 
21 typedef enum OSSharedDataType
22 {
29 
30 BOOL
32  uint32_t unk_r4,
33  void **outPtr,
34  uint32_t *outSize);
35 
36 /*
37  * Can only be called from Root (process)
38  */
39 void
41 
65 void *
66 OSBlockMove(void *dst,
67  const void *src,
68  uint32_t size,
69  BOOL flush);
70 
86 void *
87 OSBlockSet(void *dst,
88  uint8_t val,
89  uint32_t size);
90 
91 void *
92 OSAllocFromSystem(uint32_t size,
93  int align);
94 
95 void
96 OSFreeToSystem(void *ptr);
97 
114 BOOL
115 OSGetForegroundBucket(uint32_t *outAddr,
116  uint32_t *outSize);
117 
131 BOOL
133  uint32_t *outSize);
134 
150 int
152  uint32_t *outAddr,
153  uint32_t *outSize);
154 
159 void
160 __OSZeroProcessMemory(uint32_t proccesID);
161 
162 #ifdef __cplusplus
163 }
164 #endif
165 
void OSFreeToSystem(void *ptr)
void * OSBlockSet(void *dst, uint8_t val, uint32_t size)
Fills a chunk of memory with the given value, like memset.
BOOL OSGetForegroundBucketFreeArea(uint32_t *outAddr, uint32_t *outSize)
Gets the location and size of the application-usable portion of the foreground bucket area.
int OSGetMemBound(OSMemoryType type, uint32_t *outAddr, uint32_t *outSize)
Gets the location and size of available memory areas.
OSMemoryType
Definition: memory.h:16
void * OSBlockMove(void *dst, const void *src, uint32_t size, BOOL flush)
Moves chunks of memory around, similarly to memmove.
void * OSAllocFromSystem(uint32_t size, int align)
void __OSZeroProcessMemory(uint32_t proccesID)
Zeros the memory for a given proccessID.
BOOL OSGetForegroundBucket(uint32_t *outAddr, uint32_t *outSize)
Gets the location and size of the foreground bucket memory area.
OSSharedDataType
Definition: memory.h:22
void __OSRootLoadShared()
BOOL OSGetSharedData(OSSharedDataType type, uint32_t unk_r4, void **outPtr, uint32_t *outSize)
@ OS_MEM1
Definition: memory.h:17
@ OS_MEM2
Definition: memory.h:18
@ OS_SHAREDDATATYPE_FONT_TAIWANESE
Definition: memory.h:26
@ OS_SHAREDDATATYPE_FONT_CHINESE
Definition: memory.h:23
@ OS_SHAREDDATATYPE_FONT_STANDARD
Definition: memory.h:25
@ OS_SHAREDDATATYPE_FONT_KOREAN
Definition: memory.h:24
@ OS_SHAREDDATATYPE_FONT_MAX
Definition: memory.h:27
int32_t BOOL
Definition: wut_types.h:7