From a23e246286a4ca8c75f4d4f1fe9c38dbc762b1b3 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Sun, 25 Feb 2018 20:23:29 +0000 Subject: [PATCH] debug: return new panic code if stack is smashed. 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 --- 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 6554a5122..672fa5bf3 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