Serenity Operating System
1/*
2 * Copyright (c) 2018-2022, James Mintram <me@jamesrm.com>
3 * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
4 *
5 * SPDX-License-Identifier: BSD-2-Clause
6 */
7
8#pragma once
9
10#include <AK/Platform.h>
11
12#define PAGE_MASK (~(FlatPtr)0xfffu)
13
14#define LSW(x) ((u32)(x)&0xFFFF)
15#define MSW(x) (((u32)(x) >> 16) & 0xFFFF)
16#define LSB(x) ((x)&0xFF)
17#define MSB(x) (((x) >> 8) & 0xFF)
18
19#if ARCH(X86_64)
20# include <Kernel/Arch/x86_64/CPU.h>
21#elif ARCH(AARCH64)
22# include <Kernel/Arch/aarch64/CPU.h>
23#else
24# error "Unknown architecture"
25#endif
26
27namespace Kernel {
28
29struct RegisterState;
30
31void dump_registers(RegisterState const& regs);
32void handle_crash(RegisterState const&, char const* description, int signal, bool out_of_memory = false);
33
34}