arch/arm64: call PANIC in arm64_fatal_error

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
zhangyuan21 2023-04-10 21:15:17 +08:00 committed by Xiang Xiao
parent e4ae2b48b8
commit 2c599bb9e6

View File

@ -301,25 +301,6 @@ void up_mdelay(unsigned int milliseconds)
}
}
/****************************************************************************
* Name: arm64_dump_fatal
****************************************************************************/
void arm64_dump_fatal(struct regs_context *regs)
{
#ifdef CONFIG_SCHED_BACKTRACE
struct tcb_s *rtcb = (struct tcb_s *)regs->tpidr_el1;
/* Show back trace */
sched_dumpstack(rtcb->pid);
#endif
/* Dump the registers */
up_dump_register(regs);
}
/****************************************************************************
* Name: arm64_fatal_error
*
@ -330,10 +311,10 @@ void arm64_dump_fatal(struct regs_context *regs)
void arm64_fatal_error(unsigned int reason, struct regs_context * reg)
{
uint64_t el, esr, elr, far;
int cpu = up_cpu_index();
sinfo("reason = %d\n", reason);
sinfo("arm64_fatal_error: CPU%d task: %s\n", cpu, running_task()->name);
CURRENT_REGS = (uint64_t *)reg;
if (reason != K_ERR_SPURIOUS_IRQ)
{
@ -391,13 +372,5 @@ void arm64_fatal_error(unsigned int reason, struct regs_context * reg)
}
}
if (reg != NULL)
{
arm64_dump_fatal(reg);
}
for (; ; )
{
up_mdelay(1000);
}
PANIC();
}