[Sound-open-firmware] [PATCH] panic: fill stack space with frames.

Liam Girdwood liam.r.girdwood at linux.intel.com
Mon Feb 26 12:38:54 CET 2018


Fill all available stack dump space with frames if available and update
any panic code to include passed value.

Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
---
 src/include/reef/panic.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/include/reef/panic.h b/src/include/reef/panic.h
index 6466cc8..e8b4ae2 100644
--- a/src/include/reef/panic.h
+++ b/src/include/reef/panic.h
@@ -43,16 +43,19 @@
 static inline void panic_rewind(uint32_t p, uint32_t stack_rewind_frames)
 {
 	void *ext_offset;
+	size_t count;
 
 	/* disable all IRQs */
 	interrupt_global_disable();
 
 	/* dump DSP core registers */
 	ext_offset = arch_dump_regs();
+	count = MAILBOX_EXCEPTION_SIZE -
+		(size_t)(ext_offset - mailbox_get_exception_base());
 
 	/* dump stack frames */
-	dump_stack(SOF_IPC_PANIC_EXCEPTION, ext_offset, stack_rewind_frames,
-		ARCH_STACK_DUMP_FRAMES * sizeof(uint32_t));
+	p = dump_stack(p, ext_offset, stack_rewind_frames,
+		count * sizeof(uint32_t));
 
 	/* TODO: send IPC oops message to host */
 
-- 
2.14.1



More information about the Sound-open-firmware mailing list