aboutsummaryrefslogtreecommitdiff
path: root/include/apos
diff options
context:
space:
mode:
Diffstat (limited to 'include/apos')
-rw-r--r--include/apos/attrs.h2
-rw-r--r--include/apos/init.h25
-rw-r--r--include/apos/main.h8
-rw-r--r--include/apos/mem.h5
4 files changed, 29 insertions, 11 deletions
diff --git a/include/apos/attrs.h b/include/apos/attrs.h
index ae936d9..469b7bd 100644
--- a/include/apos/attrs.h
+++ b/include/apos/attrs.h
@@ -7,4 +7,6 @@
#define __packed __attribute__((packed))
#define __weak __attribute__((weak))
+#define __main __section(".kernel.start") __noinline
+
#endif /* APOS_COMPILER_ATTRIBUTES_H */
diff --git a/include/apos/init.h b/include/apos/init.h
index 1bf6a9e..1d687cb 100644
--- a/include/apos/init.h
+++ b/include/apos/init.h
@@ -1,9 +1,28 @@
#ifndef APOS_INIT_H
#define APOS_INIT_H
-#include <apos/attrs.h>
+#include <apos/pmem.h>
-#define __init
-#define __initdata
+struct init_data_t {
+ paddr_t init_base;
+ paddr_t init_top;
+
+ paddr_t initrd_base;
+ paddr_t initrd_top;
+
+ paddr_t fdt_base;
+ paddr_t fdt_top;
+
+ paddr_t stack_base;
+ paddr_t stack_top;
+
+ struct vm_branch_t *kernel_vm_base;
+
+ /*
+ TODO: is this necessary?
+ paddr_t pmap_base;
+ paddr_t pmap_top;
+ */
+};
#endif /* APOS_INIT_H */
diff --git a/include/apos/main.h b/include/apos/main.h
deleted file mode 100644
index 15fff73..0000000
--- a/include/apos/main.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef APOS_MAIN_H
-#define APOS_MAIN_H
-
-#include <apos/attrs.h>
-
-#define __main __section(".kernel.start") __noinline
-
-#endif /* APOS_MAIN_H */
diff --git a/include/apos/mem.h b/include/apos/mem.h
index 158ac5e..4846f5e 100644
--- a/include/apos/mem.h
+++ b/include/apos/mem.h
@@ -127,4 +127,9 @@
#define __o_container(idx) ((idx) / MM_OINFO_WIDTH)
#define __o_bit(idx) ((idx) & (MM_OINFO_WIDTH - 1))
+
+extern const size_t mm_shifts[10];
+extern const size_t mm_widths[10];
+extern const size_t mm_sizes[10];
+
#endif /* APOS_MEM_H */