Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/arch/xtensa/include/arch/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ static inline void exception(void)

__asm__ __volatile__("rsr %0, EPC1" : "=a" (epc1) : : "memory");

/* now panic and rewind 8 stack frames. */
/* now save panic dump */
/* TODO: we could invoke a GDB stub here */
panic_rewind(SOF_IPC_PANIC_EXCEPTION, 8 * sizeof(uint32_t),
NULL, &epc1);
panic_dump(SOF_IPC_PANIC_EXCEPTION, NULL, &epc1);
}

/**
Expand Down
9 changes: 4 additions & 5 deletions src/debug/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ void dump_panicinfo(void *addr, struct sof_ipc_panic_info *panic_info)
dcache_writeback_region(addr, sizeof(struct sof_ipc_panic_info));
}

/* panic and rewind stack */
void panic_rewind(uint32_t p, uint32_t stack_rewind_frames,
struct sof_ipc_panic_info *panic_info, uintptr_t *data)
void panic_dump(uint32_t p, struct sof_ipc_panic_info *panic_info,
uintptr_t *data)
{
char *ext_offset;
size_t count;
Expand All @@ -56,7 +55,7 @@ void panic_rewind(uint32_t p, uint32_t stack_rewind_frames,
#endif

/* dump stack frames */
p = dump_stack(p, ext_offset, stack_rewind_frames, count, &stack_ptr);
p = dump_stack(p, ext_offset, 0, count, &stack_ptr);

/* dump DSP core registers
* after arch_dump_regs() use only inline funcs if needed
Expand Down Expand Up @@ -109,5 +108,5 @@ void __panic(uint32_t p, char *filename, uint32_t linenum)
"a3", "memory");
#endif

panic_rewind(p, 0, &panicinfo, NULL);
panic_dump(p, &panicinfo, NULL);
}
4 changes: 2 additions & 2 deletions src/include/sof/debug/panic.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#endif

void dump_panicinfo(void *addr, struct sof_ipc_panic_info *panic_info);
void panic_rewind(uint32_t p, uint32_t stack_rewind_frames,
struct sof_ipc_panic_info *panic_info, uintptr_t *data)
void panic_dump(uint32_t p, struct sof_ipc_panic_info *panic_info,
uintptr_t *data)
SOF_NORETURN;
void __panic(uint32_t p, char *filename, uint32_t linenum) SOF_NORETURN;

Expand Down