From c63f340d90800895f007de64b7d2d14624263331 Mon Sep 17 00:00:00 2001 From: nthnluu Date: Sun, 28 Jan 2024 21:20:27 -0500 Subject: Created student weenix repository --- kernel/include/util/init.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 kernel/include/util/init.h (limited to 'kernel/include/util/init.h') 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); -- cgit v1.2.3-70-g09d2