From b289fed3b7be9295933faeb081c7eeed8fa856d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= Date: Mon, 24 Apr 2017 05:41:14 +0200 Subject: [PATCH] os_functions: Add OSIsAddressValid This functions checks whether a virtual address is mapped readable. --- os_functions.c | 2 ++ os_functions.h | 1 + 2 files changed, 3 insertions(+) diff --git a/os_functions.c b/os_functions.c index 08514a1..7dc077a 100644 --- a/os_functions.c +++ b/os_functions.c @@ -101,6 +101,7 @@ EXPORT_DECL(void *, MEMDestroyExpHeap, s32 heap); EXPORT_DECL(void, MEMFreeToExpHeap, s32 heap, void* ptr); EXPORT_DECL(void *, OSAllocFromSystem, int size, int alignment); EXPORT_DECL(void, OSFreeToSystem, void *addr); +EXPORT_DECL(int, OSIsAddressValid, void *ptr); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //! MCP functions @@ -272,6 +273,7 @@ void InitOSFunctionPointers(void) OS_FIND_EXPORT(coreinit_handle, MEMFreeToExpHeap); OS_FIND_EXPORT(coreinit_handle, OSAllocFromSystem); OS_FIND_EXPORT(coreinit_handle, OSFreeToSystem); + OS_FIND_EXPORT(coreinit_handle, OSIsAddressValid); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //! Other function addresses diff --git a/os_functions.h b/os_functions.h index 474db4d..289d602 100644 --- a/os_functions.h +++ b/os_functions.h @@ -140,6 +140,7 @@ extern void *(* MEMDestroyExpHeap)(s32 heap); extern void (* MEMFreeToExpHeap)(s32 heap, void* ptr); extern void* (* OSAllocFromSystem)(int size, int alignment); extern void (* OSFreeToSystem)(void *addr); +extern int (* OSIsAddressValid)(void *ptr); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //! MCP functions