From 3d072ecedaa8cb5e406eb73c3f31dfd2b6fdef55 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 3 May 2021 06:19:00 +0000 Subject: [PATCH] change some commented vfp paths to riscv64 fpu equivalents ok mlarkin@ --- sys/arch/riscv64/riscv64/machdep.c | 4 +--- sys/arch/riscv64/riscv64/syscall.c | 8 ++------ sys/arch/riscv64/riscv64/vm_machdep.c | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/arch/riscv64/riscv64/machdep.c b/sys/arch/riscv64/riscv64/machdep.c index ad092e9ba2c..24f3e030a19 100644 --- a/sys/arch/riscv64/riscv64/machdep.c +++ b/sys/arch/riscv64/riscv64/machdep.c @@ -373,10 +373,8 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack, struct trapframe *tf; /* If we were using the FPU, forget about it. */ -#if 0 // XXX ignore fp for now if (p->p_addr->u_pcb.pcb_fpcpu != NULL) - vfp_discard(p); -#endif + fpu_discard(p); p->p_addr->u_pcb.pcb_flags &= ~PCB_FPU; tf = p->p_addr->u_pcb.pcb_tf; diff --git a/sys/arch/riscv64/riscv64/syscall.c b/sys/arch/riscv64/riscv64/syscall.c index a3ca998c8fb..a37d46cd332 100644 --- a/sys/arch/riscv64/riscv64/syscall.c +++ b/sys/arch/riscv64/riscv64/syscall.c @@ -49,16 +49,12 @@ svc_handler(trapframe_t *frame) uvmexp.syscalls++; -#if 0 // XXX Save FPU State /* Before enabling interrupts, save FPU state */ - vfp_save(); -#endif + fpu_save(p, frame); -#if 0 // XXX Re-enable interrupts /* Re-enable interrupts if they were enabled previously */ - if (__predict_true((frame->tf_spsr & I_bit) == 0)) + if (__predict_true(frame->tf_scause & EXCP_INTR)) enable_interrupts(); -#endif ap = &frame->tf_a[0]; // Pointer to first arg code = frame->tf_t[0]; // Syscall code diff --git a/sys/arch/riscv64/riscv64/vm_machdep.c b/sys/arch/riscv64/riscv64/vm_machdep.c index edb4369fe7c..97fd7eb7679 100644 --- a/sys/arch/riscv64/riscv64/vm_machdep.c +++ b/sys/arch/riscv64/riscv64/vm_machdep.c @@ -111,7 +111,7 @@ cpu_exit(struct proc *p) { /* If we were using the FPU, forget about it. */ if (p->p_addr->u_pcb.pcb_fpcpu != NULL) - fpu_discard(p); // XXX Discard FP + fpu_discard(p); pmap_deactivate(p); sched_exit(p); -- 2.20.1