1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:27:34 +00:00

Kernel: Add initial implementation of Processor in aarch64

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.
This commit is contained in:
Timon Kruiper 2022-05-09 12:14:20 +02:00 committed by Linus Groh
parent ed4bfaed12
commit c515e1341a
4 changed files with 57 additions and 14 deletions

View file

@ -0,0 +1,35 @@
/*
* 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;
}
}