Commit 6397423e authored by Yann Gautier's avatar Yann Gautier
Browse files

stm32mp1: add plat_panic_handler function



The STM32MP1 implementation of this function will call
plat_report_exception(). It displays more information about the panic
if DEBUG is enabled.
The LR register is also filled with R6 content, which hold the faulty
address. This allows debugger to reconstruct the backtrace.

Change-Id: I6710e8e2ab6658b05c5bbad2f3c545f07f355afb
Signed-off-by: default avatarYann Gautier <yann.gautier@st.com>
parent a9eda77c
...@@ -216,6 +216,23 @@ func plat_crash_console_putc ...@@ -216,6 +216,23 @@ func plat_crash_console_putc
b console_stm32_core_putc b console_stm32_core_putc
endfunc plat_crash_console_putc endfunc plat_crash_console_putc
/* ----------------------------------------------------------
* void plat_panic_handler(void) __dead2;
* Report exception + endless loop.
*
* r6 holds the address where the fault occurred.
* Filling lr with this value allows debuggers to reconstruct
* the backtrace.
* ----------------------------------------------------------
*/
func plat_panic_handler
mrs r0, cpsr
and r0, #MODE32_MASK
bl plat_report_exception
mov lr, r6
b .
endfunc plat_panic_handler
#if DEBUG #if DEBUG
.section .rodata.rev_err_str, "aS" .section .rodata.rev_err_str, "aS"
abort_str: abort_str:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment