summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-08 15:18:12 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-08 17:19:46 +0200
commite4ab908fe0c29ae7eef506149367fb2018c7c776 (patch)
tree2fe58bab9e297c40dc17b367e7d62dcc4ad4c1c0 /Kernel
parenta066dd1fac2bfea0439c9b4646a3efd6a4306b99 (diff)
downloadserenity-e4ab908fe0c29ae7eef506149367fb2018c7c776.zip
Kernel: Move global constructor invocation a bit earlier
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/init.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Kernel/init.cpp b/Kernel/init.cpp
index cd2832e985..2c46189715 100644
--- a/Kernel/init.cpp
+++ b/Kernel/init.cpp
@@ -119,6 +119,11 @@ extern "C" [[noreturn]] void init()
gdt_init();
idt_init();
+ // Invoke all static global constructors in the kernel.
+ // Note that we want to do this as early as possible.
+ for (ctor_func_t* ctor = &start_ctors; ctor < &end_ctors; ctor++)
+ (*ctor)();
+
setup_interrupts();
setup_acpi();
@@ -134,10 +139,6 @@ extern "C" [[noreturn]] void init()
setup_time_management();
- // call global constructors after gtd and itd init
- for (ctor_func_t* ctor = &start_ctors; ctor < &end_ctors; ctor++)
- (*ctor)();
-
new NullDevice;
if (!get_serial_debug())
new SerialDevice(SERIAL_COM1_ADDR, 64);