aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/gran/if/alloc.h36
-rw-r--r--include/gran/mem/ideal_alloc.h11
2 files changed, 47 insertions, 0 deletions
diff --git a/include/gran/if/alloc.h b/include/gran/if/alloc.h
new file mode 100644
index 0000000..1fec04b
--- /dev/null
+++ b/include/gran/if/alloc.h
@@ -0,0 +1,36 @@
+#ifndef GRAN_ALLOC_IF_H
+#define GRAN_ALLOC_IF_H
+
+#include <stdint.h>
+
+/* completely arbitrary values */
+enum alloc_if_op {
+ ALLOC_IF_NEW = 0x00,
+ ALLOC_IF_RM = 0x40,
+ ALLOC_IF_Q = 0x80,
+};
+
+enum alloc_if_ret {
+ ALLOC_IF_OK,
+ ALLOC_IF_ERR_SPACE,
+ ALLOC_IF_ERR_RANGE,
+};
+
+struct alloc_if_new {
+ uint64_t space, start, end;
+};
+
+struct alloc_if_rm {
+ uint64_t space, start, end;
+};
+
+struct alloc_if_q {
+ uint64_t space, addr;
+};
+
+struct alloc_if_r {
+ enum alloc_if_ret r;
+ uint64_t start, end;
+};
+
+#endif /* GRAN_ALLOC_IF_H */
diff --git a/include/gran/mem/ideal_alloc.h b/include/gran/mem/ideal_alloc.h
new file mode 100644
index 0000000..009f91a
--- /dev/null
+++ b/include/gran/mem/ideal_alloc.h
@@ -0,0 +1,11 @@
+#ifndef GRAN_IDEAL_ALLOC_H
+#define GRAN_IDEAL_ALLOC_H
+
+#include <stdint.h>
+#include <gran/if/alloc.h>
+#include <gran/component.h>
+
+struct component *create_ideal_alloc(uint64_t spaces);
+void ideal_alloc_connect(struct component *alloc, struct component *send);
+
+#endif /* GRAN_IDEAL_ALLOC_H */