From 555d301e3b1f0535bce43444606ee265185a0e76 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Mon, 15 May 2023 07:38:47 +0200 Subject: [PATCH] Kernel: Unify x86-64 and AArch64 `__panic` implementation We now have everything in the AArch64 kernel to be able to use the full `__panic` implementation, so we can share the code with x86-64. I have kept `__assertion_failed` separate for now, as the x86-64 version directly executes inline assembly, thus `Kernel/Arch/aarch64/Panic.cpp` could not be removed. --- Kernel/Arch/aarch64/Panic.cpp | 8 -------- Kernel/CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Kernel/Arch/aarch64/Panic.cpp b/Kernel/Arch/aarch64/Panic.cpp index 88c86b1fcd..85a9767404 100644 --- a/Kernel/Arch/aarch64/Panic.cpp +++ b/Kernel/Arch/aarch64/Panic.cpp @@ -22,11 +22,3 @@ using namespace Kernel; // Used for printing a nice backtrace! PANIC("Aborted"); } - -void Kernel::__panic(char const* file, unsigned int line, char const* function) -{ - critical_dmesgln("at {}:{} in {}", file, line, function); - dump_backtrace(PrintToScreen::Yes); - - Processor::halt(); -} diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index 47d1726a1e..a6c2e9437a 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -260,6 +260,7 @@ set(KERNEL_SOURCES Net/Socket.cpp Net/TCPSocket.cpp Net/UDPSocket.cpp + Panic.cpp PerformanceEventBuffer.cpp Process.cpp ProcessGroup.cpp @@ -405,7 +406,6 @@ if ("${SERENITY_ARCH}" STREQUAL "x86_64") # TODO: Share these with the aarch64 build Interrupts/SpuriousInterruptHandler.cpp kprintf.cpp - Panic.cpp ) set(KERNEL_SOURCES