mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:47:35 +00:00
Kernel/riscv64: Add a basic trap handler to pre_init
This trap handler uses the SBI to print an error message via a newly introduced panic function, which is necessary as `pre_init` is running identity mapped. Also add a header file for `pre_init.cpp` as we wan't to use the panic and `dbgln` function in the MMU init code as well.
This commit is contained in:
parent
5a8781393a
commit
27860cfaa2
2 changed files with 60 additions and 4 deletions
22
Kernel/Arch/riscv64/pre_init.h
Normal file
22
Kernel/Arch/riscv64/pre_init.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Sönke Holz <sholz8530@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Forward.h>
|
||||
#include <Kernel/Memory/PhysicalAddress.h>
|
||||
|
||||
#include <AK/Platform.h>
|
||||
VALIDATE_IS_RISCV64()
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
void dbgln_without_mmu(StringView);
|
||||
[[noreturn]] void panic_without_mmu(StringView);
|
||||
|
||||
extern "C" [[noreturn]] void pre_init(FlatPtr mhartid, PhysicalPtr fdt_phys_addr);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue