forked from Mirrors/opensbi
firware: optimize the exception exit code
There are two copies of the same abnormal exit code, this patch deletes one Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
@@ -210,7 +210,7 @@ int sbi_trap_redirect(struct sbi_trap_regs *regs,
|
||||
*
|
||||
* @param regs pointer to register state
|
||||
*/
|
||||
void sbi_trap_handler(struct sbi_trap_regs *regs)
|
||||
struct sbi_trap_regs *sbi_trap_handler(struct sbi_trap_regs *regs)
|
||||
{
|
||||
int rc = SBI_ENOTSUPP;
|
||||
const char *msg = "trap handler failed";
|
||||
@@ -236,7 +236,7 @@ void sbi_trap_handler(struct sbi_trap_regs *regs)
|
||||
msg = "unhandled external interrupt";
|
||||
goto trap_error;
|
||||
};
|
||||
return;
|
||||
return regs;
|
||||
}
|
||||
|
||||
switch (mcause) {
|
||||
@@ -271,6 +271,7 @@ void sbi_trap_handler(struct sbi_trap_regs *regs)
|
||||
trap_error:
|
||||
if (rc)
|
||||
sbi_trap_error(msg, rc, mcause, mtval, mtval2, mtinst, regs);
|
||||
return regs;
|
||||
}
|
||||
|
||||
typedef void (*trap_exit_t)(const struct sbi_trap_regs *regs);
|
||||
|
Reference in New Issue
Block a user