fix typos, some refinements
[lunaix-os.git] / lunaix-os / includes / lunaix / owloysius.h
1 #ifndef __LUNAIX_OWLOYSIUS_H
2 #define __LUNAIX_OWLOYSIUS_H
3
4 #include <lunaix/ds/ldga.h>
5
6 /**
7  * @brief stage where only basic memory management service
8  * is present
9  */
10 #define on_sysconf c_sysconf
11
12 /**
13  * @brief stage where basic memory management service
14  * interrupt management and timer/clock service avaliable
15  */
16 #define on_earlyboot c_earlyboot
17
18 /**
19  * @brief stage where most kernel service is ready, non-preempt 
20  * kernel.
21  * 
22  * boot-stage initialization is about to conclude.
23  */
24 #define on_boot c_boot
25
26 /**
27  * @brief stage where all services started, kernel is in preempt
28  * state
29  */
30 #define on_postboot c_postboot
31
32 #define owloysius_fetch_init(func, call_stage)                                     \
33     export_ldga_el(lunainit, func, ptr_t, func);                            \
34     export_ldga_el_sfx(lunainit, func##_##call_stage, ptr_t, func, call_stage);
35
36 #define invoke_init_function(stage) ldga_invoke_fn0(lunainit##_##stage)
37
38 static inline void
39 initfn_invoke_sysconf()
40 {
41     invoke_init_function(on_sysconf);
42 }
43
44 static inline void
45 initfn_invoke_earlyboot()
46 {
47     invoke_init_function(on_earlyboot);
48 }
49
50 static inline void
51 initfn_invoke_boot()
52 {
53     invoke_init_function(on_boot);
54 }
55
56 static inline void
57 initfn_invoke_postboot()
58 {
59     invoke_init_function(on_postboot);
60 }
61
62 #endif /* __LUNAIX_OWLOYSIUS_H */