Skip to content

Commit

Permalink
Kernel/aarch64: Rename Processor::install to Processor::early_initialize
Browse files Browse the repository at this point in the history
Also pass the cpu number to Processor::initialize. This way the init
code can be shared between the x86_64 and aarch64 build.
  • Loading branch information
FireFox317 authored and ADKaster committed Apr 4, 2023
1 parent 14d78e1 commit 05b9eb7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Kernel/Arch/aarch64/Processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions Kernel/Arch/aarch64/Processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<typename T>
T* get_specific()
Expand Down
4 changes: 2 additions & 2 deletions Kernel/Arch/aarch64/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -130,7 +130,7 @@ extern "C" [[noreturn]] void init()
(*ctor)();
kmalloc_init();

bootstrap_processor().initialize();
bootstrap_processor().initialize(0);

load_kernel_symbol_table();

Expand Down

0 comments on commit 05b9eb7

Please sign in to comment.