summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/SDK/OS/OSAlloc.h18
-rw-r--r--include/consts.h6
2 files changed, 24 insertions, 0 deletions
diff --git a/include/SDK/OS/OSAlloc.h b/include/SDK/OS/OSAlloc.h
index 150a5f8..7a1e006 100644
--- a/include/SDK/OS/OSAlloc.h
+++ b/include/SDK/OS/OSAlloc.h
@@ -5,6 +5,8 @@
extern "C" {
#endif
+typedef s32 OSHeapHandle;
+
typedef struct Cell Cell;
struct Cell {
@@ -13,7 +15,23 @@ struct Cell {
long size;
};
+typedef struct {
+ long size;
+ Cell *free;
+ Cell *allocated;
+} HeapDesc;
+
+typedef struct {
+ volatile OSHeapHandle currentHeap;
+ int numHeaps;
+ void* arenaStart;
+ void* arenaEnd;
+ HeapDesc* heapArray;
+} OSHeapInfo;
+
Cell *DLInsert(Cell *original, Cell *inserted);
+void *OSAllocFromHeap(OSHeapHandle heap, u32 size);
+void OSFreeToHeap(OSHeapHandle heap, void *ptr);
#ifdef __cplusplus
}
diff --git a/include/consts.h b/include/consts.h
new file mode 100644
index 0000000..ed1ac6c
--- /dev/null
+++ b/include/consts.h
@@ -0,0 +1,6 @@
+#ifndef POKEREVO_CONSTS_H
+#define POKEREVO_CONSTS_H
+
+#define OSi_ROUND(n, a) (((u32) (n) + (a) - 1) & ~((a) - 1))
+
+#endif //POKEREVO_CONSTS_H