mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-08 05:43:53 +00:00

Current panic call invokes do_panic which calls el3_panic, but now panic handles only panic from EL3 anid clear separation to use lower_el_panic() which handles panic from lower ELs. So now we can remove do_panic and just call el3_panic for all panics. Change-Id: I739c69271b9fb15c1176050877a9b0c0394dc739 Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
47 lines
1 KiB
ArmAsm
47 lines
1 KiB
ArmAsm
/*
|
|
* Copyright (c) 2021, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <arch.h>
|
|
#include <asm_macros.S>
|
|
#include <common/debug.h>
|
|
|
|
.globl el2_panic
|
|
|
|
/***********************************************************
|
|
* The common implementation of el3_panic for all BL stages
|
|
***********************************************************/
|
|
|
|
.section .rodata.panic_str, "aS"
|
|
panic_msg: .asciz "PANIC at PC : 0x"
|
|
|
|
/*
|
|
* el2_panic will be redefined by the
|
|
* crash reporting mechanism (if enabled)
|
|
*/
|
|
el2_panic:
|
|
mov x6, x30
|
|
bl plat_crash_console_init
|
|
|
|
/* Check if the console is initialized */
|
|
cbz x0, _panic_handler
|
|
|
|
/* The console is initialized */
|
|
adr x4, panic_msg
|
|
bl asm_print_str
|
|
mov x4, x6
|
|
|
|
/* The panic location is lr -4 */
|
|
sub x4, x4, #4
|
|
bl asm_print_hex
|
|
|
|
bl plat_crash_console_flush
|
|
|
|
_panic_handler:
|
|
/* Pass to plat_panic_handler the address from where el2_panic was
|
|
* called, not the address of the call from el2_panic.
|
|
*/
|
|
mov x30, x6
|
|
b plat_panic_handler
|