From 05b9eb7feb43beebb5d74b8cab6d85f77f1e504c Mon Sep 17 00:00:00 2001 From: Timon Kruiper Date: Sun, 26 Mar 2023 17:28:07 +0200 Subject: [PATCH] Kernel/aarch64: Rename Processor::install to Processor::early_initialize Also pass the cpu number to Processor::initialize. This way the init code can be shared between the x86_64 and aarch64 build. --- Kernel/Arch/aarch64/Processor.cpp | 4 ++-- Kernel/Arch/aarch64/Processor.h | 4 ++-- Kernel/Arch/aarch64/init.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Kernel/Arch/aarch64/Processor.cpp b/Kernel/Arch/aarch64/Processor.cpp index 431828b380..bc45593931 100644 --- a/Kernel/Arch/aarch64/Processor.cpp +++ b/Kernel/Arch/aarch64/Processor.cpp @@ -78,7 +78,7 @@ static void load_fpu_state(FPUState* fpu_state) "\n" ::[fpu_state] "r"(fpu_state)); } -void Processor::install(u32 cpu) +void Processor::early_initialize(u32 cpu) { VERIFY(g_current_processor == nullptr); m_cpu = cpu; @@ -89,7 +89,7 @@ void Processor::install(u32 cpu) g_current_processor = this; } -void Processor::initialize() +void Processor::initialize(u32) { dmesgln("CPU[{}]: Supports {}", m_cpu, build_cpu_feature_names(m_features)); dmesgln("CPU[{}]: Physical address bit width: {}", m_cpu, m_physical_address_bit_width); diff --git a/Kernel/Arch/aarch64/Processor.h b/Kernel/Arch/aarch64/Processor.h index 9db1950180..23e51a7ffe 100644 --- a/Kernel/Arch/aarch64/Processor.h +++ b/Kernel/Arch/aarch64/Processor.h @@ -45,8 +45,8 @@ class Processor { public: Processor() = default; - void install(u32 cpu); - void initialize(); + void early_initialize(u32 cpu); + void initialize(u32 cpu); template T* get_specific() diff --git a/Kernel/Arch/aarch64/init.cpp b/Kernel/Arch/aarch64/init.cpp index b407c49ab8..eb84026e1d 100644 --- a/Kernel/Arch/aarch64/init.cpp +++ b/Kernel/Arch/aarch64/init.cpp @@ -121,7 +121,7 @@ extern "C" [[noreturn]] void init() CommandLine::early_initialize(""); new (&bootstrap_processor()) Processor(); - bootstrap_processor().install(0); + bootstrap_processor().early_initialize(0); // We call the constructors of kmalloc.cpp separately, because other constructors in the Kernel // might rely on being able to call new/kmalloc in the constructor. We do have to run the @@ -130,7 +130,7 @@ extern "C" [[noreturn]] void init() (*ctor)(); kmalloc_init(); - bootstrap_processor().initialize(); + bootstrap_processor().initialize(0); load_kernel_symbol_table();