mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:57:35 +00:00
Kernel: Reorganize Arch/x86 directory to Arch/x86_64 after i686 removal
No functional change.
This commit is contained in:
parent
5ff318cf3a
commit
91db482ad3
129 changed files with 482 additions and 1116 deletions
42
Kernel/Arch/x86_64/CPU.cpp
Normal file
42
Kernel/Arch/x86_64/CPU.cpp
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/Assertions.h>
|
||||
#include <Kernel/Arch/CPU.h>
|
||||
#include <Kernel/Panic.h>
|
||||
#include <Kernel/Process.h>
|
||||
|
||||
using namespace Kernel;
|
||||
|
||||
void __assertion_failed(char const* msg, char const* file, unsigned line, char const* func)
|
||||
{
|
||||
asm volatile("cli");
|
||||
critical_dmesgln("ASSERTION FAILED: {}", msg);
|
||||
critical_dmesgln("{}:{} in {}", file, line, func);
|
||||
|
||||
abort();
|
||||
}
|
||||
|
||||
[[noreturn]] void abort()
|
||||
{
|
||||
// Avoid lock ranking checks on crashing paths, just try to get some debugging messages out.
|
||||
auto thread = Thread::current();
|
||||
if (thread)
|
||||
thread->set_crashing();
|
||||
|
||||
// Switch back to the current process's page tables if there are any.
|
||||
// Otherwise stack walking will be a disaster.
|
||||
if (Process::has_current())
|
||||
Memory::MemoryManager::enter_process_address_space(Process::current());
|
||||
|
||||
PANIC("Aborted");
|
||||
}
|
||||
|
||||
[[noreturn]] void _abort()
|
||||
{
|
||||
asm volatile("ud2");
|
||||
__builtin_unreachable();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue