Kernel: Verify we are running on hart 0

This is already an implicit assumption when we initialize our CPU id.
This commit is contained in:
Idan Horowitz 2024-04-23 20:22:21 +03:00 committed by Andrew Kaster
parent d3e285c253
commit 7102d90b2b

View file

@ -243,6 +243,11 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT NO_SANITIZE_COVERAGE void init([[maybe_
new (&bsp_processor()) Processor();
bsp_processor().early_initialize(0);
#if ARCH(RISCV64)
// We implicitly assume the boot hart is hart 0 above and below
VERIFY(boot_info.mhartid == 0);
#endif
// Invoke the constructors needed for the kernel heap
for (ctor_func_t* ctor = start_heap_ctors; ctor < end_heap_ctors; ctor++)
(*ctor)();