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

Kernel: Use new halt() for all our halting needs in aarch64 Prekernel

This commit is contained in:
Nico Weber 2021-09-17 10:51:13 -04:00 committed by Linus Groh
parent 0319aa315a
commit 3a24eb323f
2 changed files with 5 additions and 7 deletions

View file

@ -12,7 +12,7 @@ start:
// Let only core 0 continue, put other cores to sleep. // Let only core 0 continue, put other cores to sleep.
mrs x13, MPIDR_EL1 mrs x13, MPIDR_EL1
and x13, x13, 0xff and x13, x13, 0xff
cbnz x13, Lhalt cbnz x13, halt
// Let stack start before .text for now. // Let stack start before .text for now.
// 512 kiB (0x8000) of stack are probably not sufficient, especially once we give the other cores some stack too, // 512 kiB (0x8000) of stack are probably not sufficient, especially once we give the other cores some stack too,
@ -21,7 +21,3 @@ start:
mov sp, x14 mov sp, x14
b init b init
Lhalt:
wfi
b Lhalt

View file

@ -7,12 +7,14 @@
#include <AK/Types.h> #include <AK/Types.h>
#include <Kernel/Prekernel/Arch/aarch64/MainIdRegister.h> #include <Kernel/Prekernel/Arch/aarch64/MainIdRegister.h>
extern "C" [[noreturn]] void halt();
extern "C" [[noreturn]] void init(); extern "C" [[noreturn]] void init();
extern "C" [[noreturn]] void init() extern "C" [[noreturn]] void init()
{ {
Prekernel::MainIdRegister id; Prekernel::MainIdRegister id;
[[maybe_unused]] unsigned part_num = id.part_num(); [[maybe_unused]] unsigned part_num = id.part_num();
for (;;) { } halt();
} }
// FIXME: Share this with the Intel Prekernel. // FIXME: Share this with the Intel Prekernel.
@ -20,7 +22,7 @@ extern size_t __stack_chk_guard;
size_t __stack_chk_guard; size_t __stack_chk_guard;
extern "C" [[noreturn]] void __stack_chk_fail(); extern "C" [[noreturn]] void __stack_chk_fail();
[[noreturn]] static void halt() [[noreturn]] void halt()
{ {
for (;;) { for (;;) {
asm volatile("wfi"); asm volatile("wfi");