Kernel: Share CrashHandler.cpp between aarch64 and x86_64

This file contains no architecture specific code, so can be moved to the
Kernel/ directory, and thus shared between aarch64 and x86_64.
This commit is contained in:
Timon Kruiper 2023-01-30 11:05:59 +01:00 committed by Linus Groh
parent 7ba9bc6338
commit 816076f71a
3 changed files with 2 additions and 22 deletions

View file

@ -1,19 +0,0 @@
/*
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Forward.h>
#include <Kernel/Arch/CPU.h>
#include <Kernel/Arch/RegisterState.h>
namespace Kernel {
void handle_crash(Kernel::RegisterState const&, char const*, int, bool)
{
TODO_AARCH64();
}
}

View file

@ -41,6 +41,7 @@ set(KERNEL_SOURCES
Bus/VirtIO/RNG.cpp
CommandLine.cpp
Coredump.cpp
CrashHandler.cpp
Credentials.cpp
Devices/AsyncDeviceRequest.cpp
Devices/Audio/AC97.cpp
@ -413,7 +414,6 @@ if ("${SERENITY_ARCH}" STREQUAL "x86_64")
${CMAKE_CURRENT_SOURCE_DIR}/Arch/x86_64/ASM_wrapper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Arch/x86_64/CPU.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Arch/x86_64/CPUID.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Arch/x86_64/CrashHandler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Arch/x86_64/InterruptManagement.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Arch/x86_64/Interrupts.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Arch/x86_64/PageDirectory.cpp
@ -454,7 +454,6 @@ elseif("${SERENITY_ARCH}" STREQUAL "aarch64")
Arch/aarch64/boot.S
Arch/aarch64/BootPPMParser.cpp
Arch/aarch64/CPUID.cpp
Arch/aarch64/CrashHandler.cpp
Arch/aarch64/CurrentTime.cpp
Arch/aarch64/Dummy.cpp
Arch/aarch64/init.cpp

View file

@ -36,7 +36,7 @@ void handle_crash(Kernel::RegisterState const& regs, char const* description, in
if (crashed_in_kernel) {
process.address_space().with([&](auto& space) { space->dump_regions(); });
PANIC("Crash in ring 0");
PANIC("Crash in kernel");
}
process.crash(signal, regs.ip(), out_of_memory);