change some commented vfp paths to riscv64 fpu equivalents
authorjsg <jsg@openbsd.org>
Mon, 3 May 2021 06:19:00 +0000 (06:19 +0000)
committerjsg <jsg@openbsd.org>
Mon, 3 May 2021 06:19:00 +0000 (06:19 +0000)
ok mlarkin@

sys/arch/riscv64/riscv64/machdep.c
sys/arch/riscv64/riscv64/syscall.c
sys/arch/riscv64/riscv64/vm_machdep.c

index ad092e9..24f3e03 100644 (file)
@@ -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;
index a3ca998..a37d46c 100644 (file)
@@ -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
index edb4369..97fd7eb 100644 (file)
@@ -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);