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: 1 addition & 4 deletions src/arch/xtensa/include/arch/sof.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,13 @@ static inline void fill_core_dump(struct sof_ipc_dsp_oops_xtensa *oops,
arch_dump_regs_a((void *)&oops->exccause, ps);
}

static inline void *arch_dump_regs(uint32_t ps)
static inline void arch_dump_regs(uint32_t ps)
{
void *buf = (void *)mailbox_get_exception_base();

fill_core_dump(buf, ps);

dcache_writeback_region(buf, sizeof(struct sof_ipc_dsp_oops_xtensa));

/* tell caller extended data can be placed hereafter */
return ((uint8_t *)buf + sizeof(struct sof_ipc_dsp_oops_xtensa));
}

#endif
15 changes: 10 additions & 5 deletions src/lib/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ void panic_rewind(uint32_t p, uint32_t stack_rewind_frames,
/* disable all IRQs */
oldps = interrupt_global_disable();

/* dump DSP core registers */
ext_offset = arch_dump_regs(oldps);
ext_offset = (void *)mailbox_get_exception_base() +
sizeof(struct sof_ipc_dsp_oops_xtensa);

/* dump panic info, filename ane linenum */
dump_panicinfo(ext_offset, panic_info);
Expand All @@ -73,14 +73,19 @@ void panic_rewind(uint32_t p, uint32_t stack_rewind_frames,
/* dump stack frames */
p = dump_stack(p, ext_offset, stack_rewind_frames, count);

/* panic - send IPC oops message to host */
platform_panic(p);

/* flush last trace messages */
#if CONFIG_TRACE
trace_flush();
#endif

/* dump DSP core registers
* after arch_dump_regs() use only inline funcs if needed
*/
arch_dump_regs(oldps);

/* panic - send IPC oops message to host */
platform_panic(p);

/* and loop forever */
while (1)
;
Expand Down