Kernel: Split Aarch64 CPU setup into two stages
Former aims to bring the processor itself into desired state, while latter allows for additional initialization with heap available.
This commit is contained in:
parent
97dce5d001
commit
a8e9591bac
Notes:
sideshowbarker
2024-07-19 16:58:44 +09:00
Author: https://github.com/konradekk Commit: https://github.com/SerenityOS/serenity/commit/a8e9591bac4 Pull-request: https://github.com/SerenityOS/serenity/pull/16781 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/gmta
3 changed files with 10 additions and 3 deletions
|
@ -27,7 +27,7 @@ extern "C" void enter_thread_context(Thread* from_thread, Thread* to_thread) __a
|
|||
|
||||
Processor* g_current_processor;
|
||||
|
||||
void Processor::initialize(u32 cpu)
|
||||
void Processor::install(u32 cpu)
|
||||
{
|
||||
VERIFY(g_current_processor == nullptr);
|
||||
m_features = detect_cpu_features();
|
||||
|
@ -37,6 +37,10 @@ void Processor::initialize(u32 cpu)
|
|||
g_current_processor = this;
|
||||
}
|
||||
|
||||
void Processor::initialize()
|
||||
{
|
||||
}
|
||||
|
||||
[[noreturn]] void Processor::halt()
|
||||
{
|
||||
disable_interrupts();
|
||||
|
|
|
@ -44,7 +44,8 @@ class Processor {
|
|||
public:
|
||||
Processor() = default;
|
||||
|
||||
void initialize(u32 cpu);
|
||||
void install(u32 cpu);
|
||||
void initialize();
|
||||
|
||||
template<typename T>
|
||||
T* get_specific()
|
||||
|
|
|
@ -147,7 +147,7 @@ extern "C" [[noreturn]] void init()
|
|||
CommandLine::early_initialize("");
|
||||
|
||||
new (&bootstrap_processor()) Processor();
|
||||
bootstrap_processor().initialize(0);
|
||||
bootstrap_processor().install(0);
|
||||
|
||||
// We want to enable the MMU as fast as possible to make the boot faster.
|
||||
init_page_tables();
|
||||
|
@ -159,6 +159,8 @@ extern "C" [[noreturn]] void init()
|
|||
(*ctor)();
|
||||
kmalloc_init();
|
||||
|
||||
bootstrap_processor().initialize();
|
||||
|
||||
load_kernel_symbol_table();
|
||||
|
||||
CommandLine::initialize();
|
||||
|
|
Loading…
Add table
Reference in a new issue