mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 04:19:37 +08:00
arch/arm64: call PANIC in arm64_fatal_error
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
@@ -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
|
* 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)
|
void arm64_fatal_error(unsigned int reason, struct regs_context * reg)
|
||||||
{
|
{
|
||||||
uint64_t el, esr, elr, far;
|
uint64_t el, esr, elr, far;
|
||||||
int cpu = up_cpu_index();
|
|
||||||
|
|
||||||
sinfo("reason = %d\n", reason);
|
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)
|
if (reason != K_ERR_SPURIOUS_IRQ)
|
||||||
{
|
{
|
||||||
@@ -391,13 +372,5 @@ void arm64_fatal_error(unsigned int reason, struct regs_context * reg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reg != NULL)
|
PANIC();
|
||||||
{
|
|
||||||
arm64_dump_fatal(reg);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; ; )
|
|
||||||
{
|
|
||||||
up_mdelay(1000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user