diff options
author | Andreas Kling <kling@serenityos.org> | 2021-06-18 16:40:56 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-18 17:40:05 +0200 |
commit | 3bf5e482cf13d9c5973822c4b7d48391f48ea95b (patch) | |
tree | 2ff5efe1dc3321e295cd5920297580f68b1e6f6b /Kernel/init.cpp | |
parent | 7b3fdd178ebec04358e4a72b97beced655049655 (diff) | |
download | serenity-3bf5e482cf13d9c5973822c4b7d48391f48ea95b.zip |
Kernel: Make the "in early boot" flag read-only-after-init
Diffstat (limited to 'Kernel/init.cpp')
-rw-r--r-- | Kernel/init.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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. |