/*---------------------------------------------------------------------------* Project: Cafe File: OSMemmap.h Copyright (C) 2011 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. *---------------------------------------------------------------------------*/ #ifndef __OS_MEMMAP_H__ #define __OS_MEMMAP_H__ #include #ifdef __cplusplus extern "C" { #endif #define OS_MAP_INVALID 0 #define OS_MAP_RO 1 #define OS_MAP_RW 2 #define OS_MAP_FREE 3 #define OS_MAP_ALLOCATED 4 #define OS_CODEGEN_DEFAULT 0 #define OS_CODEGEN_MEMCPY 0x40000000u #define OS_CODEGEN_SECURE 0x80000000u typedef u32 va_t; typedef u32 pa_t; #define OSGetPageSize() (128 * 1024) va_t OSAllocVirtAddr(va_t va, size_t size, size_t align); BOOL OSFreeVirtAddr(va_t va, size_t size); int OSQueryVirtAddr(va_t va); void OSGetMapVirtAddrRange(va_t *va, size_t *size); void OSGetDataPhysAddrRange(pa_t *datapa, size_t *datasize); void OSGetAvailPhysAddrRange(pa_t *availpa, size_t *availsize); void OSGetCodegenVirtAddrRange(va_t *codegenva, size_t *codegensize); u32 OSGetCodegenCore(void); u32 OSGetCodegenMode(void); BOOL OSMapMemory(va_t va, pa_t pa, size_t size, int mode); BOOL OSUnmapMemory(va_t va, size_t size); void OSSwitchSecCodeGenMode(BOOL execute); BOOL OSGetSecCodeGenMode(void); BOOL OSCodegenCopy(va_t codegenva, va_t va, size_t size); #ifdef __cplusplus } #endif #endif // __OS_MEMMAP_H__