From 1767d390fbf3d0c65389de46caf0b6d43ef3b6ad Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Fri, 10 Jul 2026 11:24:56 +0800 Subject: feat: establish bootable new architecture checkpoint Replace the compressed boot path with a relocatable higher-half RISC-V entry, expand memory and SMP support, and add the driver, TTY, VFS, exec, signal, syscall, initramfs, and self-test infrastructure needed for a bootable kernel checkpoint. --- na/arch/riscv/syscall/syscall_md.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'na/arch/riscv/syscall/syscall_md.cc') diff --git a/na/arch/riscv/syscall/syscall_md.cc b/na/arch/riscv/syscall/syscall_md.cc index a52eb0e..26320c8 100644 --- a/na/arch/riscv/syscall/syscall_md.cc +++ b/na/arch/riscv/syscall/syscall_md.cc @@ -11,7 +11,9 @@ */ #include +#include #include +#include void syscall_dispatch_md(arch::TrapFrame* tf) { @@ -22,7 +24,19 @@ void syscall_dispatch_md(arch::TrapFrame* tf) tf->a[3], tf->a[4], tf->a[5], }; + /* Enable interrupts so timer and preemption work during syscalls */ + arch::cpu::intr_on(); + int64 ret = syscall_dispatch(nr, args); + arch::cpu::intr_off(); + + /* sys_rt_sigreturn restores the entire TrapFrame from the signal + * frame on the user stack. Writing ret into a[0] would clobber + * the restored value, so we must skip the writeback. */ + if (nr == static_cast(SYS_rt_sigreturn)){ + return; + } tf->a[0] = static_cast(ret); /* Return value in a0 */ } + -- cgit v1.2.3