aboutsummaryrefslogtreecommitdiff
path: root/kernel/include/util/init.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include/util/init.h')
-rw-r--r--kernel/include/util/init.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/include/util/init.h b/kernel/include/util/init.h
new file mode 100644
index 0000000..9be7e3c
--- /dev/null
+++ b/kernel/include/util/init.h
@@ -0,0 +1,21 @@
+#pragma once
+
+#define init_func(func) \
+ __asm__( \
+ ".pushsection .init\n\t" \
+ ".long " #func \
+ "\n\t" \
+ ".string \"" #func \
+ "\"\n\t" \
+ ".popsection\n\t");
+#define init_depends(name) \
+ __asm__( \
+ ".pushsection .init\n\t" \
+ ".long 0\n\t" \
+ ".string \"" #name \
+ "\"\n\t" \
+ ".popsection\n\t");
+
+typedef void (*init_func_t)();
+
+void init_call_all(void);