summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2021-09-17 10:51:13 -0400
committerLinus Groh <mail@linusgroh.de>2021-09-19 17:45:59 +0200
commit3a24eb323f5065371516cf154fc152329b9998e1 (patch)
treee9d0b4bf6c7119f8f9bf5a83c3ac93950a1b667c
parent0319aa315a5b489ec5e7dea8fcb7b38d42868e24 (diff)
downloadserenity-3a24eb323f5065371516cf154fc152329b9998e1.zip
Kernel: Use new halt() for all our halting needs in aarch64 Prekernel
-rw-r--r--Kernel/Prekernel/Arch/aarch64/boot.S6
-rw-r--r--Kernel/Prekernel/Arch/aarch64/init.cpp6
2 files changed, 5 insertions, 7 deletions
diff --git a/Kernel/Prekernel/Arch/aarch64/boot.S b/Kernel/Prekernel/Arch/aarch64/boot.S
index acb60dc455..2d92aecdd9 100644
--- a/Kernel/Prekernel/Arch/aarch64/boot.S
+++ b/Kernel/Prekernel/Arch/aarch64/boot.S
@@ -12,7 +12,7 @@ start:
// Let only core 0 continue, put other cores to sleep.
mrs x13, MPIDR_EL1
and x13, x13, 0xff
- cbnz x13, Lhalt
+ cbnz x13, halt
// 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,
@@ -21,7 +21,3 @@ start:
mov sp, x14
b init
-
-Lhalt:
- wfi
- b Lhalt
diff --git a/Kernel/Prekernel/Arch/aarch64/init.cpp b/Kernel/Prekernel/Arch/aarch64/init.cpp
index 36acd399ad..70b5e42ef6 100644
--- a/Kernel/Prekernel/Arch/aarch64/init.cpp
+++ b/Kernel/Prekernel/Arch/aarch64/init.cpp
@@ -7,12 +7,14 @@
#include <AK/Types.h>
#include <Kernel/Prekernel/Arch/aarch64/MainIdRegister.h>
+extern "C" [[noreturn]] void halt();
+
extern "C" [[noreturn]] void init();
extern "C" [[noreturn]] void init()
{
Prekernel::MainIdRegister id;
[[maybe_unused]] unsigned part_num = id.part_num();
- for (;;) { }
+ halt();
}
// FIXME: Share this with the Intel Prekernel.
@@ -20,7 +22,7 @@ extern size_t __stack_chk_guard;
size_t __stack_chk_guard;
extern "C" [[noreturn]] void __stack_chk_fail();
-[[noreturn]] static void halt()
+[[noreturn]] void halt()
{
for (;;) {
asm volatile("wfi");