Kernel: Replace Prekernel::halt with Processor::halt in aarch64 build

This allows us to get rid of one more Prekernel file.
This commit is contained in:
Timon Kruiper 2022-05-09 13:33:35 +02:00 committed by Linus Groh
parent acc9be9f7d
commit e80d8d697c
Notes: sideshowbarker 2024-07-17 10:56:21 +09:00
7 changed files with 10 additions and 30 deletions

View file

@ -11,6 +11,4 @@ namespace Prekernel {
void drop_to_exception_level_1();
void init_prekernel_page_tables();
[[noreturn]] void halt();
}

View file

@ -1,21 +0,0 @@
/*
* Copyright (c) 2021, James Mintram <me@jamesrm.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/Arch/aarch64/Prekernel/Prekernel.h>
#include <Kernel/Arch/aarch64/ASM_wrapper.h>
#include <Kernel/Arch/aarch64/RPi/UART.h>
namespace Prekernel {
[[noreturn]] void halt()
{
for (;;) {
asm volatile("wfi");
}
}
}

View file

@ -13,7 +13,7 @@ start:
// Let only core 0 continue, put other cores to sleep.
mrs x13, MPIDR_EL1
and x13, x13, 0xff
cbnz x13, _ZN9Prekernel4haltEv
cbnz x13, _ZN6Kernel9Processor4haltEv
// Let stack start before .text for now.
// 512 kiB (0x80000) of stack are probably not sufficient, especially once we give the other cores some stack too,

View file

@ -32,4 +32,11 @@ void Processor::initialize(u32 cpu)
g_current_processor = this;
}
[[noreturn]] void Processor::halt()
{
for (;;)
asm volatile("wfi");
}
}

View file

@ -143,10 +143,7 @@ public:
VERIFY_NOT_REACHED();
}
[[noreturn]] static void halt()
{
for (;;) { }
}
[[noreturn]] static void halt();
};
}

View file

@ -102,7 +102,7 @@ extern "C" [[noreturn]] void __stack_chk_fail();
void __stack_chk_fail()
{
Prekernel::halt();
Kernel::Processor::halt();
}
using namespace Kernel;

View file

@ -400,7 +400,6 @@ else()
set(PREKERNEL_SOURCES
Arch/aarch64/Prekernel/Aarch64_asm_utils.S
Arch/aarch64/Prekernel/boot.S
Arch/aarch64/Prekernel/PrekernelCommon.cpp
Arch/aarch64/Prekernel/PrekernelExceptions.cpp
Arch/aarch64/Prekernel/PrekernelMMU.cpp