[kernel] call static constructors after heap init

Avoids badness when a constructor needs to malloc() something, etc.
This commit is contained in:
Will Lee
2015-07-07 15:56:00 -07:00
committed by Brian Swetland
parent eea18f45cc
commit 141e4ffaa5

View File

@@ -102,15 +102,15 @@ void lk_main(ulong arg0, ulong arg1, ulong arg2, ulong arg3)
dprintf(INFO, "boot args 0x%lx 0x%lx 0x%lx 0x%lx\n",
lk_boot_args[0], lk_boot_args[1], lk_boot_args[2], lk_boot_args[3]);
// deal with any static constructors
dprintf(SPEW, "calling constructors\n");
call_constructors();
// bring up the kernel heap
dprintf(SPEW, "initializing heap\n");
lk_primary_cpu_init_level(LK_INIT_LEVEL_TARGET_EARLY, LK_INIT_LEVEL_HEAP - 1);
heap_init();
// deal with any static constructors
dprintf(SPEW, "calling constructors\n");
call_constructors();
// initialize the kernel
lk_primary_cpu_init_level(LK_INIT_LEVEL_HEAP, LK_INIT_LEVEL_KERNEL - 1);
kernel_init();