From cbd0c8ce1d517277f55ef749497477e377e0d8fd Mon Sep 17 00:00:00 2001 From: jsg Date: Sun, 9 May 2021 06:34:21 +0000 Subject: [PATCH] fix indentation --- sys/arch/riscv64/riscv64/trap.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/sys/arch/riscv64/riscv64/trap.c b/sys/arch/riscv64/riscv64/trap.c index 7e1286ee013..82ec476ad16 100644 --- a/sys/arch/riscv64/riscv64/trap.c +++ b/sys/arch/riscv64/riscv64/trap.c @@ -105,7 +105,6 @@ do_trap_supervisor(struct trapframe *frame) } } - void do_trap_user(struct trapframe *frame) { @@ -162,27 +161,26 @@ do_trap_user(struct trapframe *frame) svc_handler(frame); break; case EXCP_ILLEGAL_INSTRUCTION: + if ((frame->tf_sstatus & SSTATUS_FS_MASK) == SSTATUS_FS_OFF) { + if (fpu_valid_opcode(frame->tf_stval)) { - if ((frame->tf_sstatus & SSTATUS_FS_MASK) == - SSTATUS_FS_OFF) { - if(fpu_valid_opcode(frame->tf_stval)) { - - /* XXX do this here or should it be in the - * trap handler in the restore path? - */ - fpu_load(p); + /* XXX do this here or should it be in the + * trap handler in the restore path? + */ + fpu_load(p); - frame->tf_sstatus &= ~SSTATUS_FS_MASK; - break; + frame->tf_sstatus &= ~SSTATUS_FS_MASK; + break; + } } - } - printf("ILL at %lx scause %lx stval %lx\n", frame->tf_sepc, frame->tf_scause, frame->tf_stval); + printf("ILL at %lx scause %lx stval %lx\n", frame->tf_sepc, + frame->tf_scause, frame->tf_stval); sv.sival_ptr = (void *)frame->tf_stval; trapsignal(p, SIGILL, 0, ILL_ILLTRP, sv); userret(p); break; case EXCP_BREAKPOINT: - printf("BREAKPOINT\n"); + printf("BREAKPOINT\n"); sv.sival_ptr = (void *)frame->tf_stval; trapsignal(p, SIGTRAP, 0, TRAP_BRKPT, sv); userret(p); @@ -290,4 +288,3 @@ fatal: panic("Fatal page fault at %#lx: %#08lx", frame->tf_sepc, (vaddr_t)sv.sival_ptr); } - -- 2.20.1