1 /*---------------------------------------------------------------------------* 2 3 Copyright (C) Nintendo. All rights reserved. 4 5 These coded instructions, statements, and computer programs contain 6 proprietary information of Nintendo of America Inc. and/or Nintendo 7 Company Ltd., and are protected by Federal copyright law. They may 8 not be disclosed to third parties or copied or duplicated in any form, 9 in whole or in part, without the prior written consent of Nintendo. 10 11 *---------------------------------------------------------------------------*/ 12 // -------------------------------------------------- 13 // windows/mem.h 14 // 15 // Include file for GX2 files that are also built on the PC. 16 // 17 // This should only be included by Windows Projects! 18 // 19 // Stubs mem functionality 20 // 21 // -------------------------------------------------- 22 23 #ifndef __WINDOWS_MEM_H__ 24 #define __WINDOWS_MEM_H__ 25 26 typedef void * MEMHeapHandle; 27 #define align(a) 28 #define __attribute__(a) 29 #define MEM_HEAP_INVALID_HANDLE NULL 30 #define MEM_HEAP_DEFAULT_ALIGNMENT 4 31 #define MEMAllocator u32 32 #define MEMAllocFromDefaultHeap(size) malloc(size) 33 #define MEMAllocFromDefaultHeapEx(size, alignment) malloc(size) 34 #define MEMAllocFromExpHeap(heap, size) malloc(size) 35 #define MEMAllocFromExpHeapEx(heap, size, alignment) malloc(size) 36 #define MEMAllocFromFrmHeap(heap, size) malloc(size) 37 #define MEMAllocFromFrmHeapEx(heap, size, alignment) malloc(size) 38 #define MEMFreeToDefaultHeap(memBlock) free(memBlock) 39 #define MEMFreeToExpHeap(heap, memBlock) free(memBlock) 40 #define MEMFreeToFrmHeap(heap, mode) free(heap) 41 #define MEMFreeToAllocator(pAllocator, memBlock) free(memBlock) 42 #define MEMGetAllocatableSizeForDefaultHeapEx(heap, alignment) 0x2000000 //32MB, not sure what to say 43 #define MEMGetAllocatableSizeForExpHeapEx(heap, alignment) 0x2000000 //32MB, not sure what to say 44 #define MEMGetAllocatableSizeForFrmHeapEx(heap, alignment) 0x2000000 //32MB, not sure what to say 45 #define MEMAllocFromAllocator(pAllocator, size) malloc(size) 46 #define MEM_FRMHEAP_FREE_HEAD (1 <<0) 47 #define MEM_FRMHEAP_FREE_TAIL (1 <<1) 48 #define MEM_FRMHEAP_FREE_ALL (MEM_FRMHEAP_FREE_HEAD | MEM_FRMHEAP_FREE_TAIL) 49 #define MEMGetBaseHeapHandle(arena) NULL 50 #define MEMCreateExpHeap(startAddress, size) malloc(size) 51 #define MEMInitAllocatorForExpHeap(pAllocator, heap, alignment) 52 #define MEMDestroyExpHeap(heap) NULL 53 #define ProcUISetMEM1Storage(data, size) 54 #define LL_CACHE_FETCH_SIZE 64 // last-level cache fetch size. Can be 32 or 64 bytes. 55 56 #define PPC_IO_BUFFER_SIZE_MIN LL_CACHE_FETCH_SIZE 57 #define PPC_IO_BUFFER_ALIGN LL_CACHE_FETCH_SIZE 58 #define PPC_GET_CORE_ID() 0 59 60 #endif // __WINDOWS_MEM_H__ 61