summaryrefslogtreecommitdiff
path: root/include/lib/arena.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lib/arena.h')
-rw-r--r--include/lib/arena.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/lib/arena.h b/include/lib/arena.h
new file mode 100644
index 0000000..9d3cb38
--- /dev/null
+++ b/include/lib/arena.h
@@ -0,0 +1,31 @@
+/**
+ * @file arena.h
+ * @author x221e
+ * @brief linear arena-allocation without relocation
+ * @description
+ * This will be a linear arena allocation,
+ * no free functionality exists right now.
+ *
+ * @todo create a larger arena structure that would hold regions
+ */
+
+#ifndef ARENA_H
+#define ARENA_H
+
+#include <stddef.h>
+
+// 2 MiB regions
+#define REGION_MAX_CAPACITY 1024*1024*2
+
+struct region { // or arena?
+ size_t capacity;
+ size_t size;
+ void *end;
+ void *start;
+};
+
+int region_init(struct region *r);
+void *region_alloc(struct region *r, size_t b);
+int region_pop(struct region *r, size_t b);
+
+#endif
> Hosts the 0x221E linux distro kernel.Ubuntu
summaryrefslogtreecommitdiff
path: root/arch/powerpc/boot/dts/p1020rdb-pc_36b.dts
AgeCommit message (Expand)Author
2012-03-16powerpc/85xx: Add dts for p1020rdb-pc boardZhicheng Fan