KernOS
global.cpp
Go to the documentation of this file.
1 //
2 // Created on 5/24/20.
3 //
4 
5 #include <global.h>
6 #include <ktypes.h>
7 
11 extern func_ptr start_ctors;
12 
16 extern func_ptr end_ctors;
17 
18 namespace INIT
19 {
29  void ctors()
30  {
31 
32  for (func_ptr *ctor = &start_ctors; ctor < &end_ctors; ++ctor) {
33  (*ctor)();
34  }
35  }
36 } // namespace INIT
37 
void(*)() func_ptr
Definition: ktypes.h:16
void ctors()
calls constructors on all global objects
Definition: global.cpp:29
contains all kernel initialization routines
Definition: cpu.h:10
func_ptr start_ctors
starting address of pointers to global constructors
func_ptr end_ctors
ending address of pointers to global constructors