diff --git a/include/coreinit/frameheap.h b/include/coreinit/frameheap.h index fd3df2a..fc9cf44 100644 --- a/include/coreinit/frameheap.h +++ b/include/coreinit/frameheap.h @@ -14,8 +14,9 @@ extern "C" { typedef enum MEMFrameHeapFreeMode { - MEM_FRAME_HEAP_FREE_FROM_BOTTOM = 1 << 0, - MEM_FRAME_HEAP_FREE_FROM_TOP = 1 << 1, + MEM_FRAME_HEAP_FREE_HEAD = 1 << 0, + MEM_FRAME_HEAP_FREE_TAIL = 1 << 1, + MEM_FRAME_HEAP_FREE_ALL = MEM_FRAME_HEAP_FREE_HEAD | MEM_FRAME_HEAP_FREE_TAIL, } MEMFrameHeapFreeMode; typedef struct MEMFrameHeap MEMFrameHeap; @@ -48,7 +49,7 @@ CHECK_OFFSET(MEMFrameHeap, 0x48, previousState); CHECK_SIZE(MEMFrameHeap, 0x4C); MEMFrameHeap * -MEMCreateFrmHeapEx(MEMFrameHeap *heap, +MEMCreateFrmHeapEx(void *heap, uint32_t size, uint32_t flags); diff --git a/include/coreinit/memheap.h b/include/coreinit/memheap.h index 9951e8d..d937992 100644 --- a/include/coreinit/memheap.h +++ b/include/coreinit/memheap.h @@ -24,21 +24,26 @@ typedef enum MEMHeapFillType MEM_HEAP_FILL_TYPE_FREED = 2, } MEMHeapFillType; -#define MEM_BLOCK_HEAP_TAG 0x424C4B48u -#define MEM_EXPANDED_HEAP_TAG 0x45585048u -#define MEM_FRAME_HEAP_TAG 0x46524D48u -#define MEM_UNIT_HEAP_TAG 0x554E5448u -#define MEM_USER_HEAP_TAG 0x55535248u +typedef enum MEMHeapTag +{ + MEM_BLOCK_HEAP_TAG = 0x424C4B48u, + MEM_EXPANDED_HEAP_TAG = 0x45585048u, + MEM_FRAME_HEAP_TAG = 0x46524D48u, + MEM_UNIT_HEAP_TAG = 0x554E5448u, + MEM_USER_HEAP_TAG = 0x55535248u, +} MEMHeapTag; - -#define MEM_HEAP_FLAG_ZERO_ALLOCATED (1 << 0) -#define MEM_HEAP_FLAG_DEBUG_MODE (1 << 1) -#define MEM_HEAP_FLAG_USE_LOCK (1 << 2) +typedef enum MEMHeapFlags +{ + MEM_HEAP_FLAG_ZERO_ALLOCATED = 1 << 0, + MEM_HEAP_FLAG_DEBUG_MODE = 1 << 1, + MEM_HEAP_FLAG_USE_LOCK = 1 << 2, +} MEMHeapFlags; struct MEMHeapHeader { //! Tag indicating which type of heap this is - uint32_t tag; + MEMHeapTag tag; //! Link for list this heap is in MEMMemoryLink link; diff --git a/include/coreinit/memlist.h b/include/coreinit/memlist.h index 7544807..4841e0c 100644 --- a/include/coreinit/memlist.h +++ b/include/coreinit/memlist.h @@ -19,7 +19,6 @@ struct MEMMemoryLink void *prev; void *next; }; - CHECK_OFFSET(MEMMemoryLink, 0x0, prev); CHECK_OFFSET(MEMMemoryLink, 0x4, next); CHECK_SIZE(MEMMemoryLink, 0x8);