From 3bf5e482cf13d9c5973822c4b7d48391f48ea95b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 18 Jun 2021 16:40:56 +0200 Subject: Kernel: Make the "in early boot" flag read-only-after-init --- Kernel/init.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Kernel/init.cpp') diff --git a/Kernel/init.cpp b/Kernel/init.cpp index 3711ec7ed6..9f057a3e77 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -75,7 +75,7 @@ multiboot_module_entry_t multiboot_copy_boot_modules_array[16]; size_t multiboot_copy_boot_modules_count; extern "C" const char kernel_cmdline[4096]; -bool g_in_early_boot; +READONLY_AFTER_INIT bool g_in_early_boot; namespace Kernel { @@ -259,15 +259,15 @@ void init_stage2(void*) load_kernel_symbol_table(); + // Switch out of early boot mode. + g_in_early_boot = false; + // NOTE: Everything marked READONLY_AFTER_INIT becomes non-writable after this point. MM.protect_readonly_after_init_memory(); // NOTE: Everything marked UNMAP_AFTER_INIT becomes inaccessible after this point. MM.unmap_memory_after_init(); - // Switch out of early boot mode. - g_in_early_boot = false; - int error; // FIXME: It would be nicer to set the mode from userspace. -- cgit v1.2.3