WUT  0.1
Wii U Toolchain
memheap.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 #include "spinlock.h"
4 #include "memlist.h"
5 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
19 
20 typedef enum MEMHeapFillType
21 {
26 
27 typedef enum MEMHeapTag
28 {
29  MEM_BLOCK_HEAP_TAG = 0x424C4B48u,
30  MEM_EXPANDED_HEAP_TAG = 0x45585048u,
31  MEM_FRAME_HEAP_TAG = 0x46524D48u,
32  MEM_UNIT_HEAP_TAG = 0x554E5448u,
33  MEM_USER_HEAP_TAG = 0x55535248u,
34 } MEMHeapTag;
35 
36 typedef enum MEMHeapFlags
37 {
41 } MEMHeapFlags;
42 
44 {
47 
50 
53 
55  void *dataStart;
56 
58  void *dataEnd;
59 
62 
64  uint32_t flags;
65 
66  UNKNOWN(0x0C);
67 };
68 CHECK_OFFSET(MEMHeapHeader, 0x00, tag);
69 CHECK_OFFSET(MEMHeapHeader, 0x04, link);
70 CHECK_OFFSET(MEMHeapHeader, 0x0C, list);
71 CHECK_OFFSET(MEMHeapHeader, 0x18, dataStart);
72 CHECK_OFFSET(MEMHeapHeader, 0x1C, dataEnd);
73 CHECK_OFFSET(MEMHeapHeader, 0x20, lock);
74 CHECK_OFFSET(MEMHeapHeader, 0x30, flags);
75 CHECK_SIZE(MEMHeapHeader, 0x40);
76 
80 void
82 
87 MEMFindContainHeap(void *block);
88 
92 uint32_t
94 
98 void
100  uint32_t value);
101 
102 #ifdef __cplusplus
103 }
104 #endif
105 
MEMMemoryList list
List of all child heaps in this heap.
Definition: memheap.h:52
uint32_t MEMGetFillValForHeap(MEMHeapFillType type)
void MEMSetFillValForHeap(MEMHeapFillType type, uint32_t value)
MEMHeapHeader * MEMFindContainHeap(void *block)
void * dataEnd
Pointer to end of allocatable memory.
Definition: memheap.h:58
MEMHeapTag tag
Tag indicating which type of heap this is.
Definition: memheap.h:46
MEMMemoryLink link
Link for list this heap is in.
Definition: memheap.h:49
MEMHeapFillType
Definition: memheap.h:20
void * dataStart
Pointer to start of allocatable memory.
Definition: memheap.h:55
MEMHeapFlags
Definition: memheap.h:36
uint32_t flags
Flags set during heap creation.
Definition: memheap.h:64
OSSpinLock lock
Lock used when MEM_HEAP_FLAG_USE_LOCK is set.
Definition: memheap.h:61
void MEMDumpHeap(MEMHeapHeader *heap)
MEMHeapTag
Definition: memheap.h:27