diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sbi/sbi_ecall.c | 2 | ||||
-rw-r--r-- | lib/sbi/sbi_illegal_insn.c | 5 | ||||
-rw-r--r-- | lib/sbi/sbi_misaligned_ldst.c | 12 | ||||
-rw-r--r-- | lib/sbi/sbi_trap.c | 6 |
4 files changed, 11 insertions, 14 deletions
diff --git a/lib/sbi/sbi_ecall.c b/lib/sbi/sbi_ecall.c index 6acb1b7..230dfa3 100644 --- a/lib/sbi/sbi_ecall.c +++ b/lib/sbi/sbi_ecall.c @@ -111,7 +111,7 @@ int sbi_ecall_handler(u32 hartid, ulong mcause, struct sbi_trap_regs *regs, if (ret == SBI_ETRAP) { trap.epc = regs->mepc; - sbi_trap_redirect(regs, &trap, scratch); + sbi_trap_redirect(regs, &trap); } else { /* * This function should return non-zero value only in case of diff --git a/lib/sbi/sbi_illegal_insn.c b/lib/sbi/sbi_illegal_insn.c index 81e4199..a374fa2 100644 --- a/lib/sbi/sbi_illegal_insn.c +++ b/lib/sbi/sbi_illegal_insn.c @@ -32,7 +32,7 @@ static int truly_illegal_insn(ulong insn, u32 hartid, ulong mcause, trap.tval2 = 0; trap.tinst = 0; - return sbi_trap_redirect(regs, &trap, scratch); + return sbi_trap_redirect(regs, &trap); } static int system_opcode_insn(ulong insn, u32 hartid, ulong mcause, @@ -144,8 +144,7 @@ int sbi_illegal_insn_handler(u32 hartid, ulong mcause, ulong insn, insn = sbi_get_insn(regs->mepc, &uptrap); if (uptrap.cause) { uptrap.epc = regs->mepc; - return sbi_trap_redirect(regs, &uptrap, - scratch); + return sbi_trap_redirect(regs, &uptrap); } } if ((insn & 3) != 3) diff --git a/lib/sbi/sbi_misaligned_ldst.c b/lib/sbi/sbi_misaligned_ldst.c index 73814c5..7c15a40 100644 --- a/lib/sbi/sbi_misaligned_ldst.c +++ b/lib/sbi/sbi_misaligned_ldst.c @@ -45,7 +45,7 @@ int sbi_misaligned_load_handler(u32 hartid, ulong mcause, insn = sbi_get_insn(regs->mepc, &uptrap); if (uptrap.cause) { uptrap.epc = regs->mepc; - return sbi_trap_redirect(regs, &uptrap, scratch); + return sbi_trap_redirect(regs, &uptrap); } } @@ -114,7 +114,7 @@ int sbi_misaligned_load_handler(u32 hartid, ulong mcause, uptrap.tval = addr; uptrap.tval2 = tval2; uptrap.tinst = tinst; - return sbi_trap_redirect(regs, &uptrap, scratch); + return sbi_trap_redirect(regs, &uptrap); } val.data_u64 = 0; @@ -123,7 +123,7 @@ int sbi_misaligned_load_handler(u32 hartid, ulong mcause, &uptrap); if (uptrap.cause) { uptrap.epc = regs->mepc; - return sbi_trap_redirect(regs, &uptrap, scratch); + return sbi_trap_redirect(regs, &uptrap); } } @@ -165,7 +165,7 @@ int sbi_misaligned_store_handler(u32 hartid, ulong mcause, insn = sbi_get_insn(regs->mepc, &uptrap); if (uptrap.cause) { uptrap.epc = regs->mepc; - return sbi_trap_redirect(regs, &uptrap, scratch); + return sbi_trap_redirect(regs, &uptrap); } } @@ -225,7 +225,7 @@ int sbi_misaligned_store_handler(u32 hartid, ulong mcause, uptrap.tval = addr; uptrap.tval2 = tval2; uptrap.tinst = tinst; - return sbi_trap_redirect(regs, &uptrap, scratch); + return sbi_trap_redirect(regs, &uptrap); } for (i = 0; i < len; i++) { @@ -233,7 +233,7 @@ int sbi_misaligned_store_handler(u32 hartid, ulong mcause, &uptrap); if (uptrap.cause) { uptrap.epc = regs->mepc; - return sbi_trap_redirect(regs, &uptrap, scratch); + return sbi_trap_redirect(regs, &uptrap); } } diff --git a/lib/sbi/sbi_trap.c b/lib/sbi/sbi_trap.c index 9aa6b85..bab0571 100644 --- a/lib/sbi/sbi_trap.c +++ b/lib/sbi/sbi_trap.c @@ -74,13 +74,11 @@ static void __noreturn sbi_trap_error(const char *msg, int rc, u32 hartid, * * @param regs pointer to register state * @param trap pointer to trap details - * @param scratch pointer to sbi_scratch of current HART * * @return 0 on success and negative error code on failure */ int sbi_trap_redirect(struct sbi_trap_regs *regs, - struct sbi_trap_info *trap, - struct sbi_scratch *scratch) + struct sbi_trap_info *trap) { ulong hstatus, vsstatus, prev_mode; #if __riscv_xlen == 32 @@ -273,7 +271,7 @@ void sbi_trap_handler(struct sbi_trap_regs *regs, trap.tval = mtval; trap.tval2 = mtval2; trap.tinst = mtinst; - rc = sbi_trap_redirect(regs, &trap, scratch); + rc = sbi_trap_redirect(regs, &trap); break; }; |