mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-11 02:54:55 +00:00
Instead of storing the current Processor into a core local register, we currently just store it into a global, since we don't support SMP for aarch64 anyway. This simplifies the initial implementation.
36 lines
880 B
C++
36 lines
880 B
C++
/*
|
|
* Copyright (c) 2022, Timon Kruiper <timonkruiper@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <AK/Format.h>
|
|
|
|
#include <Kernel/Arch/Processor.h>
|
|
#include <Kernel/Arch/aarch64/ASM_wrapper.h>
|
|
#include <Kernel/Arch/aarch64/Prekernel/Aarch64_asm_utils.h>
|
|
#include <Kernel/Arch/aarch64/Prekernel/Prekernel.h>
|
|
|
|
extern "C" uintptr_t vector_table_el1;
|
|
|
|
namespace Kernel {
|
|
|
|
Processor* g_current_processor;
|
|
|
|
void Processor::initialize(u32 cpu)
|
|
{
|
|
VERIFY(g_current_processor == nullptr);
|
|
|
|
auto current_exception_level = static_cast<u64>(Kernel::Aarch64::Asm::get_current_exception_level());
|
|
dbgln("CPU{} started in: EL{}", cpu, current_exception_level);
|
|
|
|
dbgln("Drop CPU{} to EL1", cpu);
|
|
Prekernel::drop_to_exception_level_1();
|
|
|
|
// Load EL1 vector table
|
|
el1_vector_table_install(&vector_table_el1);
|
|
|
|
g_current_processor = this;
|
|
}
|
|
}
|