/*---------------------------------------------------------------------------* Copyright 2010-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. *---------------------------------------------------------------------------*/ // -------------------------------------------------- // windows/mem.h // // Include file for GX2 files that are also built on the PC. // // This should only be included by Windows Projects! // // Stubs mem functionality // // -------------------------------------------------- #ifndef __WINDOWS_MEM_H__ #define __WINDOWS_MEM_H__ typedef void * MEMHeapHandle; #define align(a) #define __attribute__(a) #define MEM_HEAP_INVALID_HANDLE NULL #define MEM_HEAP_DEFAULT_ALIGNMENT 4 #define MEMAllocator u32 #define MEMAllocFromDefaultHeap(size) malloc(size) #define MEMAllocFromDefaultHeapEx(size, alignment) malloc(size) #define MEMAllocFromExpHeap(heap, size) malloc(size) #define MEMAllocFromExpHeapEx(heap, size, alignment) malloc(size) #define MEMAllocFromFrmHeap(heap, size) malloc(size) #define MEMAllocFromFrmHeapEx(heap, size, alignment) malloc(size) #define MEMFreeToDefaultHeap(memBlock) free(memBlock) #define MEMFreeToExpHeap(heap, memBlock) free(memBlock) #define MEMFreeToFrmHeap(heap, mode) free(heap) #define MEMFreeToAllocator(pAllocator, memBlock) free(memBlock) #define MEMGetAllocatableSizeForDefaultHeapEx(heap, alignment) 0x2000000 //32MB, not sure what to say #define MEMGetAllocatableSizeForExpHeapEx(heap, alignment) 0x2000000 //32MB, not sure what to say #define MEMGetAllocatableSizeForFrmHeapEx(heap, alignment) 0x2000000 //32MB, not sure what to say #define MEMAllocFromAllocator(pAllocator, size) malloc(size) #define MEM_FRMHEAP_FREE_HEAD (1 <<0) #define MEM_FRMHEAP_FREE_TAIL (1 <<1) #define MEM_FRMHEAP_FREE_ALL (MEM_FRMHEAP_FREE_HEAD | MEM_FRMHEAP_FREE_TAIL) #define MEMGetBaseHeapHandle(arena) NULL #define MEMCreateExpHeap(startAddress, size) malloc(size) #define MEMInitAllocatorForExpHeap(pAllocator, heap, alignment) #define MEMDestroyExpHeap(heap) NULL #define ProcUISetMEM1Storage(data, size) #define LL_CACHE_FETCH_SIZE 64 // last-level cache fetch size. Can be 32 or 64 bytes. #define PPC_IO_BUFFER_SIZE_MIN LL_CACHE_FETCH_SIZE #define PPC_IO_BUFFER_ALIGN LL_CACHE_FETCH_SIZE #define PPC_GET_CORE_ID() 0 #endif // __WINDOWS_MEM_H__