Fix compilation on riscv64gc.

This commit is contained in:
4lDO2
2025-04-16 11:46:59 +02:00
parent 4d49f1a8e4
commit 1227f2222e
2 changed files with 9 additions and 3 deletions
+8 -3
View File
@@ -1,13 +1,15 @@
use ::syscall::Exception;
use core::{arch::global_asm, sync::atomic::Ordering};
use log::{error, info};
use rmm::VirtualAddress;
use crate::{
arch::{device::irqchip, start::BOOT_HART_ID},
context::signal::excp_handler,
memory::GenericPfFlags,
panic::stack_trace,
ptrace, syscall,
syscall::flag::*,
ptrace,
syscall::{self, flag::*},
};
const BREAKPOINT: usize = 3;
@@ -171,13 +173,16 @@ unsafe fn handle_user_exception(scause: usize, regs: &mut InterruptStack) {
);
regs.dump();
// TODO
/*
let signal = match scause {
0 | 4 | 6 | 18 | 19 => SIGBUS, // misaligned / machine check
2 | 8 | 9 => SIGILL, // Illegal instruction / breakpoint / ecall
BREAKPOINT => SIGTRAP,
_ => SIGSEGV,
};
crate::ksignal(signal);
*/
excp_handler(Exception { kind: scause });
}
unsafe fn page_fault(scause: usize, regs: &mut InterruptStack, user_mode: bool) -> bool {
+1
View File
@@ -127,6 +127,7 @@ impl super::Context {
None => Err(Error::new(ESRCH)),
}
}
pub fn set_userspace_io_allowed(&mut self, _allowed: bool) {}
}
pub static EMPTY_CR3: Once<rmm::PhysicalAddress> = Once::new();