From bab17a41c32269f57b708db6940ba1bfe7b8d336 Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 7 May 2020 14:31:51 +0200 Subject: [PATCH] coreinit/memory.h: add OSMemoryBarrier, __OSZeroProcessMemory, OSGetSharedData (#126) - add function OSMemoryBarrier - add function __OSZeroProcessMemory - add function OSGetSharedData + enum OSSharedDataType --- include/coreinit/memory.h | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/include/coreinit/memory.h b/include/coreinit/memory.h index e8805b54..81bef22f 100644 --- a/include/coreinit/memory.h +++ b/include/coreinit/memory.h @@ -14,10 +14,25 @@ extern "C" { typedef enum OSMemoryType { - OS_MEM1 = 1, - OS_MEM2 = 2, + OS_MEM1 = 1, + OS_MEM2 = 2, } OSMemoryType; +typedef enum OSSharedDataType +{ + OS_SHAREDDATATYPE_FONT_CHINESE = 0, + OS_SHAREDDATATYPE_FONT_KOREAN = 1, + OS_SHAREDDATATYPE_FONT_STANDARD = 2, + OS_SHAREDDATATYPE_FONT_TAIWANESE = 3, + OS_SHAREDDATATYPE_FONT_MAX = 4 +} OSSharedDataType; + +BOOL +OSGetSharedData(OSSharedDataType type, + uint32_t unk_r4, + void** outPtr, + uint32_t* outSize); + /** * Moves chunks of memory around, similarly to memmove. Overlapping source and * destination regions are supported. @@ -131,6 +146,16 @@ OSGetMemBound(OSMemoryType type, uint32_t *outAddr, uint32_t *outSize); +void +OSMemoryBarrier(); + +/** + * Zeros the memory for a given proccessID. + * Works only inside the ROOT process. + * +**/ +void +__OSZeroProcessMemory(uint32_t proccesID); #ifdef __cplusplus } #endif