1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 03:05:07 +00:00
serenity/Kernel/Arch/x86/common/CPU.cpp
Andreas Kling cd8d52e6ae Kernel: Improve API names for switching address spaces
- enter_space => enter_address_space
- enter_process_paging_scope => enter_process_address_space
2021-09-06 18:56:51 +02:00

35 lines
830 B
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Assertions.h>
#include <Kernel/Arch/x86/CPU.h>
#include <Kernel/Panic.h>
#include <Kernel/Process.h>
void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func)
{
asm volatile("cli");
critical_dmesgln("ASSERTION FAILED: {}", msg);
critical_dmesgln("{}:{} in {}", file, line, func);
abort();
}
[[noreturn]] void abort()
{
// Switch back to the current process's page tables if there are any.
// Otherwise stack walking will be a disaster.
if (Process::has_current())
MM.enter_process_address_space(Process::current());
PANIC("Aborted");
}
[[noreturn]] void _abort()
{
asm volatile("ud2");
__builtin_unreachable();
}