Author: trasz
Date: Thu Oct  8 11:04:32 2020
New Revision: 366534
URL: https://svnweb.freebsd.org/changeset/base/366534

Log:
  Remove yet another useless assignment, adding a KASSERT just in case.
  
  Reviewed by:  kp
  Sponsored by: DARPA
  Differential Revision:        https://reviews.freebsd.org/D26698

Modified:
  head/sys/riscv/riscv/trap.c

Modified: head/sys/riscv/riscv/trap.c
==============================================================================
--- head/sys/riscv/riscv/trap.c Thu Oct  8 10:59:49 2020        (r366533)
+++ head/sys/riscv/riscv/trap.c Thu Oct  8 11:04:32 2020        (r366534)
@@ -158,15 +158,12 @@ dump_regs(struct trapframe *frame)
 }
 
 static void
-ecall_handler(struct trapframe *frame)
+ecall_handler(void)
 {
        struct thread *td;
 
        td = curthread;
 
-       KASSERT(td->td_frame == frame,
-           ("%s: td_frame %p != frame %p", __func__, td->td_frame, frame));
-
        syscallenter(td);
        syscallret(td);
 }
@@ -324,9 +321,11 @@ do_trap_user(struct trapframe *frame)
        struct pcb *pcb;
 
        td = curthread;
-       td->td_frame = frame;
        pcb = td->td_pcb;
 
+       KASSERT(td->td_frame == frame,
+           ("%s: td_frame %p != frame %p", __func__, td->td_frame, frame));
+
        /* Ensure we came from usermode, interrupts disabled */
        KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == 0,
            ("Came from U mode with interrupts enabled"));
@@ -357,7 +356,7 @@ do_trap_user(struct trapframe *frame)
                break;
        case EXCP_USER_ECALL:
                frame->tf_sepc += 4;    /* Next instruction */
-               ecall_handler(frame);
+               ecall_handler();
                break;
        case EXCP_ILLEGAL_INSTRUCTION:
 #ifdef FPE
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to