struct sbi_scratch;
int sbi_trap_redirect(struct sbi_trap_regs *regs,
- struct sbi_trap_info *trap,
- struct sbi_scratch *scratch);
+ struct sbi_trap_info *trap);
void sbi_trap_handler(struct sbi_trap_regs *regs,
struct sbi_scratch *scratch);
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
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,
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)
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);
}
}
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;
&uptrap);
if (uptrap.cause) {
uptrap.epc = regs->mepc;
- return sbi_trap_redirect(regs, &uptrap, scratch);
+ return sbi_trap_redirect(regs, &uptrap);
}
}
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);
}
}
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++) {
&uptrap);
if (uptrap.cause) {
uptrap.epc = regs->mepc;
- return sbi_trap_redirect(regs, &uptrap, scratch);
+ return sbi_trap_redirect(regs, &uptrap);
}
}
*
* @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
trap.tval = mtval;
trap.tval2 = mtval2;
trap.tinst = mtinst;
- rc = sbi_trap_redirect(regs, &trap, scratch);
+ rc = sbi_trap_redirect(regs, &trap);
break;
};