[Sound-open-firmware] [PATCH] debug: return new panic code if stack is smashed.

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


Change the panic code is stack has been smashed. This allows platform
specific handlers to send new panic code to host if stack is smashed.

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

diff --git a/src/include/reef/debug.h b/src/include/reef/debug.h
index 6554a51..672fa5b 100644
--- a/src/include/reef/debug.h
+++ b/src/include/reef/debug.h
@@ -128,7 +128,7 @@
 #endif
 
 /* dump stack as part of panic */
-static inline void dump_stack(uint32_t p, void *addr, size_t offset,
+static inline uint32_t dump_stack(uint32_t p, void *addr, size_t offset,
 	size_t limit)
 {
 	extern void *__stack;
@@ -142,7 +142,7 @@ static inline void dump_stack(uint32_t p, void *addr, size_t offset,
 	if (stack_top - offset <= stack_limit) {
 		stack_bottom = stack_limit;
 		p = SOF_IPC_PANIC_STACK;
-		platform_panic(p);
+		return p;
 	}
 
 	/* make sure stack size won't overflow dump area */
@@ -152,6 +152,7 @@ static inline void dump_stack(uint32_t p, void *addr, size_t offset,
 	/* copy stack contents and writeback */
 	rmemcpy(addr, stack_top, size - sizeof(void *));
 	dcache_writeback_region(addr, size - sizeof(void *));
+	return p;
 }
 
 #endif
-- 
2.14.1



More information about the Sound-open-firmware mailing list