mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-06-25 23:58:55 +00:00
lib: sbi_trap: Remove scratch parameter from sbi_trap_redirect()
The scratch parameter of sbi_trap_redirect() is not used hence we remove it. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
parent
626467cfd9
commit
cb78a48231
5 changed files with 12 additions and 16 deletions
|
@ -205,8 +205,7 @@ struct sbi_trap_info {
|
||||||
struct sbi_scratch;
|
struct sbi_scratch;
|
||||||
|
|
||||||
int sbi_trap_redirect(struct sbi_trap_regs *regs,
|
int sbi_trap_redirect(struct sbi_trap_regs *regs,
|
||||||
struct sbi_trap_info *trap,
|
struct sbi_trap_info *trap);
|
||||||
struct sbi_scratch *scratch);
|
|
||||||
|
|
||||||
void sbi_trap_handler(struct sbi_trap_regs *regs,
|
void sbi_trap_handler(struct sbi_trap_regs *regs,
|
||||||
struct sbi_scratch *scratch);
|
struct sbi_scratch *scratch);
|
||||||
|
|
|
@ -111,7 +111,7 @@ int sbi_ecall_handler(u32 hartid, ulong mcause, struct sbi_trap_regs *regs,
|
||||||
|
|
||||||
if (ret == SBI_ETRAP) {
|
if (ret == SBI_ETRAP) {
|
||||||
trap.epc = regs->mepc;
|
trap.epc = regs->mepc;
|
||||||
sbi_trap_redirect(regs, &trap, scratch);
|
sbi_trap_redirect(regs, &trap);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* This function should return non-zero value only in case of
|
* This function should return non-zero value only in case of
|
||||||
|
|
|
@ -32,7 +32,7 @@ static int truly_illegal_insn(ulong insn, u32 hartid, ulong mcause,
|
||||||
trap.tval2 = 0;
|
trap.tval2 = 0;
|
||||||
trap.tinst = 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,
|
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);
|
insn = sbi_get_insn(regs->mepc, &uptrap);
|
||||||
if (uptrap.cause) {
|
if (uptrap.cause) {
|
||||||
uptrap.epc = regs->mepc;
|
uptrap.epc = regs->mepc;
|
||||||
return sbi_trap_redirect(regs, &uptrap,
|
return sbi_trap_redirect(regs, &uptrap);
|
||||||
scratch);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((insn & 3) != 3)
|
if ((insn & 3) != 3)
|
||||||
|
|
|
@ -45,7 +45,7 @@ int sbi_misaligned_load_handler(u32 hartid, ulong mcause,
|
||||||
insn = sbi_get_insn(regs->mepc, &uptrap);
|
insn = sbi_get_insn(regs->mepc, &uptrap);
|
||||||
if (uptrap.cause) {
|
if (uptrap.cause) {
|
||||||
uptrap.epc = regs->mepc;
|
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.tval = addr;
|
||||||
uptrap.tval2 = tval2;
|
uptrap.tval2 = tval2;
|
||||||
uptrap.tinst = tinst;
|
uptrap.tinst = tinst;
|
||||||
return sbi_trap_redirect(regs, &uptrap, scratch);
|
return sbi_trap_redirect(regs, &uptrap);
|
||||||
}
|
}
|
||||||
|
|
||||||
val.data_u64 = 0;
|
val.data_u64 = 0;
|
||||||
|
@ -123,7 +123,7 @@ int sbi_misaligned_load_handler(u32 hartid, ulong mcause,
|
||||||
&uptrap);
|
&uptrap);
|
||||||
if (uptrap.cause) {
|
if (uptrap.cause) {
|
||||||
uptrap.epc = regs->mepc;
|
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);
|
insn = sbi_get_insn(regs->mepc, &uptrap);
|
||||||
if (uptrap.cause) {
|
if (uptrap.cause) {
|
||||||
uptrap.epc = regs->mepc;
|
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.tval = addr;
|
||||||
uptrap.tval2 = tval2;
|
uptrap.tval2 = tval2;
|
||||||
uptrap.tinst = tinst;
|
uptrap.tinst = tinst;
|
||||||
return sbi_trap_redirect(regs, &uptrap, scratch);
|
return sbi_trap_redirect(regs, &uptrap);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
|
@ -233,7 +233,7 @@ int sbi_misaligned_store_handler(u32 hartid, ulong mcause,
|
||||||
&uptrap);
|
&uptrap);
|
||||||
if (uptrap.cause) {
|
if (uptrap.cause) {
|
||||||
uptrap.epc = regs->mepc;
|
uptrap.epc = regs->mepc;
|
||||||
return sbi_trap_redirect(regs, &uptrap, scratch);
|
return sbi_trap_redirect(regs, &uptrap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,13 +74,11 @@ static void __noreturn sbi_trap_error(const char *msg, int rc, u32 hartid,
|
||||||
*
|
*
|
||||||
* @param regs pointer to register state
|
* @param regs pointer to register state
|
||||||
* @param trap pointer to trap details
|
* @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
|
* @return 0 on success and negative error code on failure
|
||||||
*/
|
*/
|
||||||
int sbi_trap_redirect(struct sbi_trap_regs *regs,
|
int sbi_trap_redirect(struct sbi_trap_regs *regs,
|
||||||
struct sbi_trap_info *trap,
|
struct sbi_trap_info *trap)
|
||||||
struct sbi_scratch *scratch)
|
|
||||||
{
|
{
|
||||||
ulong hstatus, vsstatus, prev_mode;
|
ulong hstatus, vsstatus, prev_mode;
|
||||||
#if __riscv_xlen == 32
|
#if __riscv_xlen == 32
|
||||||
|
@ -273,7 +271,7 @@ void sbi_trap_handler(struct sbi_trap_regs *regs,
|
||||||
trap.tval = mtval;
|
trap.tval = mtval;
|
||||||
trap.tval2 = mtval2;
|
trap.tval2 = mtval2;
|
||||||
trap.tinst = mtinst;
|
trap.tinst = mtinst;
|
||||||
rc = sbi_trap_redirect(regs, &trap, scratch);
|
rc = sbi_trap_redirect(regs, &trap);
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue