From 1227f2222e28da8e9a4ad234fc51abba9d64a8ae Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Wed, 16 Apr 2025 11:46:59 +0200 Subject: [PATCH] Fix compilation on riscv64gc. --- src/arch/riscv64/interrupt/exception.rs | 11 ++++++++--- src/context/arch/riscv64.rs | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/arch/riscv64/interrupt/exception.rs b/src/arch/riscv64/interrupt/exception.rs index ed135f0512..56495197ad 100644 --- a/src/arch/riscv64/interrupt/exception.rs +++ b/src/arch/riscv64/interrupt/exception.rs @@ -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 { diff --git a/src/context/arch/riscv64.rs b/src/context/arch/riscv64.rs index 27bac6e4be..1f484811ef 100644 --- a/src/context/arch/riscv64.rs +++ b/src/context/arch/riscv64.rs @@ -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 = Once::new();