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 <liam.r.girdwood@linux.intel.com>
This commit is contained in:
Liam Girdwood 2018-02-25 20:23:29 +00:00
parent c38eb34669
commit a23e246286
1 changed files with 3 additions and 2 deletions

View File

@ -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