coreinit: Fill out MEMUnitHeap structure.

This commit is contained in:
James Benton 2016-10-09 21:16:40 +01:00
parent 0a34d5b7a2
commit 4a595fba93
2 changed files with 17 additions and 2 deletions

View File

@ -11,7 +11,7 @@
* want to run in parallel. You must ensure the previous filesystem command
* has been completed before reusing the same FSCmdBlock, you do not need to
* reinitialise an FSCmdBlock before reusing it.
*
*
* Calling fsDevInit initializes the stdlib devoptab, allowing for standard
* file IO.
* @{

View File

@ -1,5 +1,6 @@
#pragma once
#include <wut.h>
#include "memheap.h"
/**
* \defgroup coreinit_unitheap Unit Heap
@ -12,11 +13,25 @@ extern "C" {
#endif
typedef struct MEMUnitHeap MEMUnitHeap;
typedef struct MEMUnitHeapFreeBlock MEMUnitHeapFreeBlock;
struct MEMUnitHeapFreeBlock
{
MEMUnitHeapFreeBlock *next;
};
CHECK_OFFSET(MEMUnitHeapFreeBlock, 0x00, next);
CHECK_SIZE(MEMUnitHeapFreeBlock, 0x04);
struct MEMUnitHeap
{
MEMHeapHeader header;
MEMUnitHeapFreeBlock *freeBlocks;
uint32_t blockSize;
};
UNKNOWN_SIZE(MEMUnitHeap);
CHECK_OFFSET(MEMUnitHeap, 0x00, header);
CHECK_OFFSET(MEMUnitHeap, 0x40, freeBlocks);
CHECK_OFFSET(MEMUnitHeap, 0x44, blockSize);
CHECK_SIZE(MEMUnitHeap, 0x48);
MEMUnitHeap *
MEMCreateUnitHeapEx(MEMUnitHeap *heap,