1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-18 20:42:09 +00:00

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.
This commit is contained in:
Timon Kruiper 2023-03-26 17:28:07 +02:00 committed by Andrew Kaster
parent 14d78e10d1
commit 05b9eb7feb
3 changed files with 6 additions and 6 deletions

View file

@ -78,7 +78,7 @@ static void load_fpu_state(FPUState* fpu_state)
"\n" ::[fpu_state] "r"(fpu_state)); "\n" ::[fpu_state] "r"(fpu_state));
} }
void Processor::install(u32 cpu) void Processor::early_initialize(u32 cpu)
{ {
VERIFY(g_current_processor == nullptr); VERIFY(g_current_processor == nullptr);
m_cpu = cpu; m_cpu = cpu;
@ -89,7 +89,7 @@ void Processor::install(u32 cpu)
g_current_processor = this; g_current_processor = this;
} }
void Processor::initialize() void Processor::initialize(u32)
{ {
dmesgln("CPU[{}]: Supports {}", m_cpu, build_cpu_feature_names(m_features)); dmesgln("CPU[{}]: Supports {}", m_cpu, build_cpu_feature_names(m_features));
dmesgln("CPU[{}]: Physical address bit width: {}", m_cpu, m_physical_address_bit_width); dmesgln("CPU[{}]: Physical address bit width: {}", m_cpu, m_physical_address_bit_width);

View file

@ -45,8 +45,8 @@ class Processor {
public: public:
Processor() = default; Processor() = default;
void install(u32 cpu); void early_initialize(u32 cpu);
void initialize(); void initialize(u32 cpu);
template<typename T> template<typename T>
T* get_specific() T* get_specific()

View file

@ -121,7 +121,7 @@ extern "C" [[noreturn]] void init()
CommandLine::early_initialize(""); CommandLine::early_initialize("");
new (&bootstrap_processor()) Processor(); 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 // 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 // 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)(); (*ctor)();
kmalloc_init(); kmalloc_init();
bootstrap_processor().initialize(); bootstrap_processor().initialize(0);
load_kernel_symbol_table(); load_kernel_symbol_table();