Skip to content

Commit abe4bb0

Browse files
committed
exception: Improve IRQ/FIQ log messages
Signed-off-by: Hector Martin <[email protected]>
1 parent ebd4613 commit abe4bb0

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

src/exception.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,19 +306,26 @@ void exc_sync(u64 *regs)
306306

307307
void exc_irq(u64 *regs)
308308
{
309+
u64 spsr = in_gl12() ? mrs(SYS_IMP_APL_SPSR_GL1) : mrs(SPSR_EL1);
309310
u32 reason = aic_ack();
310311

311-
printf("Exception: IRQ (from %s) die: %lu type: %lu num: %lu mpidr: %lx\n",
312-
get_exception_source(0), FIELD_GET(AIC_EVENT_DIE, reason),
313-
FIELD_GET(AIC_EVENT_TYPE, reason), FIELD_GET(AIC_EVENT_NUM, reason), mrs(MPIDR_EL1));
312+
do {
313+
printf("Exception: IRQ (from %s) die: %lu type: %lu num: %lu mpidr: %lx cnt: %lx\n",
314+
get_exception_source(spsr), FIELD_GET(AIC_EVENT_DIE, reason),
315+
FIELD_GET(AIC_EVENT_TYPE, reason), FIELD_GET(AIC_EVENT_NUM, reason), mrs(MPIDR_EL1),
316+
mrs(CNTPCT_EL0));
317+
318+
reason = aic_ack();
319+
} while (reason);
314320

315321
UNUSED(regs);
316322
// print_regs(regs);
317323
}
318324

319325
void exc_fiq(u64 *regs)
320326
{
321-
printf("Exception: FIQ (from %s)\n", get_exception_source(0));
327+
u64 spsr = in_gl12() ? mrs(SYS_IMP_APL_SPSR_GL1) : mrs(SPSR_EL1);
328+
printf("Exception: FIQ (from %s) cnt: %lx\n", get_exception_source(spsr), mrs(CNTPCT_EL0));
322329

323330
u64 reg = mrs(CNTP_CTL_EL0);
324331
if (reg == 0x5) {

0 commit comments

Comments
 (0)