diff options
author | Timon Kruiper <timonkruiper@gmail.com> | 2022-05-09 13:33:35 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-05-12 23:14:05 +0200 |
commit | e80d8d697c0464d1cd86dccf183998615b9f43fc (patch) | |
tree | 9223658cd252ad8714c5d8f5f28173f268fa3526 | |
parent | acc9be9f7d6d65278fa912ca5d9af5762e91eb70 (diff) | |
download | serenity-e80d8d697c0464d1cd86dccf183998615b9f43fc.zip |
Kernel: Replace Prekernel::halt with Processor::halt in aarch64 build
This allows us to get rid of one more Prekernel file.
-rw-r--r-- | Kernel/Arch/aarch64/Prekernel/Prekernel.h | 2 | ||||
-rw-r--r-- | Kernel/Arch/aarch64/Prekernel/PrekernelCommon.cpp | 21 | ||||
-rw-r--r-- | Kernel/Arch/aarch64/Prekernel/boot.S | 2 | ||||
-rw-r--r-- | Kernel/Arch/aarch64/Processor.cpp | 7 | ||||
-rw-r--r-- | Kernel/Arch/aarch64/Processor.h | 5 | ||||
-rw-r--r-- | Kernel/Arch/aarch64/init.cpp | 2 | ||||
-rw-r--r-- | Kernel/CMakeLists.txt | 1 |
7 files changed, 10 insertions, 30 deletions
diff --git a/Kernel/Arch/aarch64/Prekernel/Prekernel.h b/Kernel/Arch/aarch64/Prekernel/Prekernel.h index d86e05b179..8763be3ccd 100644 --- a/Kernel/Arch/aarch64/Prekernel/Prekernel.h +++ b/Kernel/Arch/aarch64/Prekernel/Prekernel.h @@ -11,6 +11,4 @@ namespace Prekernel { void drop_to_exception_level_1(); void init_prekernel_page_tables(); -[[noreturn]] void halt(); - } diff --git a/Kernel/Arch/aarch64/Prekernel/PrekernelCommon.cpp b/Kernel/Arch/aarch64/Prekernel/PrekernelCommon.cpp deleted file mode 100644 index a7836a0400..0000000000 --- a/Kernel/Arch/aarch64/Prekernel/PrekernelCommon.cpp +++ /dev/null @@ -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"); - } -} - -} diff --git a/Kernel/Arch/aarch64/Prekernel/boot.S b/Kernel/Arch/aarch64/Prekernel/boot.S index 4c44b5288a..f4ec015a4b 100644 --- a/Kernel/Arch/aarch64/Prekernel/boot.S +++ b/Kernel/Arch/aarch64/Prekernel/boot.S @@ -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, diff --git a/Kernel/Arch/aarch64/Processor.cpp b/Kernel/Arch/aarch64/Processor.cpp index 1cc104dfbd..85d15037f9 100644 --- a/Kernel/Arch/aarch64/Processor.cpp +++ b/Kernel/Arch/aarch64/Processor.cpp @@ -32,4 +32,11 @@ void Processor::initialize(u32 cpu) g_current_processor = this; } + +[[noreturn]] void Processor::halt() +{ + for (;;) + asm volatile("wfi"); +} + } diff --git a/Kernel/Arch/aarch64/Processor.h b/Kernel/Arch/aarch64/Processor.h index 17393471cf..01a1d5c134 100644 --- a/Kernel/Arch/aarch64/Processor.h +++ b/Kernel/Arch/aarch64/Processor.h @@ -143,10 +143,7 @@ public: VERIFY_NOT_REACHED(); } - [[noreturn]] static void halt() - { - for (;;) { } - } + [[noreturn]] static void halt(); }; } diff --git a/Kernel/Arch/aarch64/init.cpp b/Kernel/Arch/aarch64/init.cpp index da2222ffbb..9049ac3b37 100644 --- a/Kernel/Arch/aarch64/init.cpp +++ b/Kernel/Arch/aarch64/init.cpp @@ -102,7 +102,7 @@ extern "C" [[noreturn]] void __stack_chk_fail(); void __stack_chk_fail() { - Prekernel::halt(); + Kernel::Processor::halt(); } using namespace Kernel; diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index cae9bb2fd0..4a5d5720f8 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -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 |