serenity/Kernel/Arch/aarch64/Panic.cpp
Liav A 7c0540a229 Everywhere: Move global Kernel pattern code to Kernel/Library directory
This has KString, KBuffer, DoubleBuffer, KBufferBuilder, IOWindow,
UserOrKernelBuffer and ScopedCritical classes being moved to the
Kernel/Library subdirectory.

Also, move the panic and assertions handling code to that directory.
2023-06-04 21:32:34 +02:00

25 lines
803 B
C++

/*
* Copyright (c) 2022, Timon Kruiper <timonkruiper@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/Arch/Processor.h>
#include <Kernel/KSyms.h>
#include <Kernel/Library/Panic.h>
// FIXME: Merge the code in this file with Kernel/Library/Panic.cpp once the proper abstractions are in place.
// Note: This is required here, since __assertion_failed should be out of the Kernel namespace,
// but the PANIC macro uses functions that require the Kernel namespace.
using namespace Kernel;
[[noreturn]] void __assertion_failed(char const* msg, char const* file, unsigned line, char const* func)
{
critical_dmesgln("ASSERTION FAILED: {}", msg);
critical_dmesgln("{}:{} in {}", file, line, func);
// Used for printing a nice backtrace!
PANIC("Aborted");
}