/*---------------------------------------------------------------------------* Project: Cafe File: OSMemory.h Copyright 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_MEMORY_H__ #define __OS_MEMORY_H__ #include #ifdef __cplusplus extern "C" { #endif /*---------------------------------------------------------------------------*/ typedef enum _osMemType { OSMem_MEM1=1, OSMem_MEM2=2 } OSMemType; int OSGetMemBound(OSMemType memType, u32 *apRetStart, u32 *apRetSizeBytes); int OSSetMemBound(OSMemType memType, u32 aStart, u32 aSizeBytes); void * OSAllocFromSystem(u32 aSize, int aAlign); void OSFreeToSystem(void *aPtr); /*---------------------------------------------------------------------------*/ void * OSBlockMove(void* dst, const void* src, size_t size, BOOL flush); void * OSBlockSet(void* dst, u8 val, size_t size); /*---------------------------------------------------------------------------*/ typedef enum _osShared { SHARED_FONT_CAFECN, SHARED_FONT_CAFEKR, SHARED_FONT_CAFESTD, SHARED_FONT_CAFETW } OSShared; BOOL OSGetSharedData(OSShared aShared, u32 aFlags, void **appRetArea, u32 *apRetSizeBytes); BOOL OSIsAddressValid(void *addr); #define OVERLAY_ARENA_ERROR_INVALID 0xFFFFFFFF #define OVERLAY_ARENA_ERROR_IN_SHUTDOWN 0xFFFFFFFD #define OVERLAY_ARENA_ERROR_TIMEOUT 0xFFFFFFFC #define OVERLAY_ARENA_ERROR_ALREADY_ENABLED 0xFFFFFFFB #define OVERLAY_ARENA_ERROR_NOT_ENABLED 0xFFFFFFFA #define OVERLAY_ARENA_ERROR_UNKNOWN 0xFFFFFFF9 #define OVERLAY_ARENA_ERROR_NOT_SET_IN_PLAT_INFO 0xFFFFFFF8 BOOL OSIsEnabledOverlayArenaDev(void); void OSEnableOverlayArenaDev(BOOL allowAV, u32 *addr, u32 *size); BOOL OSEnableOverlayArenaWithTimeoutDev(BOOL allowAV, u32 timeout, u32 *error, u32 *addr, u32 *size); void OSDisableOverlayArenaDev(void); BOOL OSDisableOverlayArenaWithTimeoutDev(u32 timeout, u32 *error); /*---------------------------------------------------------------------------*/ #ifdef __cplusplus } #endif #endif // __OS_MEMORY_H__