]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
refactor(aarch64): rename do_panic and el3_panic
authorGovindraj Raja <govindraj.raja@arm.com>
Mon, 16 Jan 2023 17:35:07 +0000 (17:35 +0000)
committerGovindraj Raja <govindraj.raja@arm.com>
Tue, 21 Feb 2023 17:26:01 +0000 (17:26 +0000)
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>
bl31/aarch64/ea_delegate.S
bl31/aarch64/runtime_exceptions.S
common/aarch32/debug.S
common/aarch64/debug.S
docs/getting_started/porting-guide.rst
include/arch/aarch64/el3_common_macros.S
include/common/debug.h
plat/arm/board/fvp_r/fvp_r_debug.S
plat/renesas/common/aarch64/plat_helpers.S

index dbb32344dfe35745f05122c46718b7a855783f20..0661583ca58c4b6baadd82bfc5152eebc237a03b 100644 (file)
@@ -201,7 +201,7 @@ func delegate_async_ea
         */
        ubfx    x2, x1, #ESR_EC_SHIFT, #ESR_EC_LENGTH
        cmp     x2, EC_SERROR
-       b.ne    do_panic
+       b.ne    el3_panic
        /*
         * Check for Implementation Defined Syndrome. If so, skip checking
         * Uncontainable error type from the syndrome as the format is unknown.
index 0c608597c1d896ed9d5f14e1b1158546fb2bf8ae..cf79361c21924fa0daaf2777238ed1afe53cbe47 100644 (file)
@@ -563,7 +563,7 @@ sysreg_handler64:
         */
 
        tst     w0, w0
-       b.mi    do_panic        /* negative return value: panic */
+       b.mi    el3_panic       /* negative return value: panic */
        b.eq    1f              /* zero: do not change ELR_EL3 */
 
        /* advance the PC to continue after the instruction */
index ae0bb7ac7f93fe510d6c06f0fa65e8480e0d6f41..2937f56fd9d2d2cf83a254235623235c41e89a3d 100644 (file)
@@ -12,7 +12,7 @@
        .globl  asm_print_hex
        .globl  asm_print_hex_bits
        .globl  asm_assert
-       .globl  do_panic
+       .globl  el3_panic
        .globl  report_exception
        .globl  report_prefetch_abort
        .globl  report_data_abort
@@ -159,14 +159,14 @@ asm_print_hex_bits:
 endfunc asm_print_hex
 
        /***********************************************************
-        * The common implementation of do_panic for all BL stages
+        * The common implementation of el3_panic for all BL stages
         ***********************************************************/
 
 .section .rodata.panic_str, "aS"
        panic_msg: .asciz "PANIC at PC : 0x"
        panic_end: .asciz "\r\n"
 
-func do_panic
+func el3_panic
        /* Have LR copy point to PC at the time of panic */
        sub     r6, lr, #4
 
@@ -194,7 +194,7 @@ func do_panic
 _panic_handler:
        mov     lr, r6
        b       plat_panic_handler
-endfunc do_panic
+endfunc el3_panic
 
        /***********************************************************
         * This function is called from the vector table for
index 6b92294c083455bdf331d4932b6207bd551ea756..82d57d7abeac40425b1cabf4472c767c7c3b7a70 100644 (file)
@@ -13,7 +13,6 @@
        .globl  asm_print_hex_bits
        .globl  asm_print_newline
        .globl  asm_assert
-       .globl  do_panic
        .globl  el3_panic
 
 /* Since the max decimal input number is 65536 */
@@ -146,30 +145,24 @@ func asm_print_newline
 endfunc asm_print_newline
 
        /***********************************************************
-        * The common implementation of do_panic for all BL stages
+        * The common implementation of el3_panic for all BL stages
         ***********************************************************/
 
 .section .rodata.panic_str, "aS"
        panic_msg: .asciz "PANIC at PC : 0x"
 
 /* ---------------------------------------------------------------------------
- * do_panic assumes that it is invoked from a C Runtime Environment ie a
+ * el3_panic assumes that it is invoked from a C Runtime Environment ie a
  * valid stack exists. This call will not return.
  * Clobber list : if CRASH_REPORTING is not enabled then x30, x0 - x6
  * ---------------------------------------------------------------------------
  */
 
-func do_panic
+func el3_panic
 #if CRASH_REPORTING && defined(IMAGE_BL31)
        b       report_el3_panic
 #endif /* CRASH_REPORTING && IMAGE_BL31 */
 
-panic_common:
-/*
- * el3_panic will be redefined by the BL31
- * crash reporting mechanism (if enabled)
- */
-el3_panic:
        mov     x6, x30
        bl      plat_crash_console_init
 
@@ -196,4 +189,4 @@ _panic_handler:
        mov     x30, x6
        b       plat_panic_handler
 
-endfunc do_panic
\ No newline at end of file
+endfunc el3_panic
\ No newline at end of file
index 80b72e52ed394a1c01a9cd45471a8b3e41ac7060..98568cd7a54dd7f2cc89716ba0cbb6e95dd02138 100644 (file)
@@ -3205,8 +3205,8 @@ as Group 0 secure interrupt, Group 1 secure interrupt or Group 1 NS interrupt.
 Common helper functions
 -----------------------
 
-Function : do_panic()
-~~~~~~~~~~~~~~~~~~~~~
+Function : el3_panic()
+~~~~~~~~~~~~~~~~~~~~~~
 
 ::
 
@@ -3214,9 +3214,8 @@ Function : do_panic()
     Return   : void
 
 This API is called from assembly files when encountering a critical failure that
-cannot be recovered from. It also invokes elx_panic() which allows to report a
-crash from lower exception level. This function assumes that it is invoked from
-a C runtime environment i.e. valid stack exists. This call **must not** return.
+cannot be recovered from. This function assumes that it is invoked from a C
+runtime environment i.e. valid stack exists. This call **must not** return.
 
 Function : panic()
 ~~~~~~~~~~~~~~~~~~
@@ -3228,7 +3227,7 @@ Function : panic()
 
 This API called from C files when encountering a critical failure that cannot
 be recovered from. This function in turn prints backtrace (if enabled) and calls
-do_panic(). This call **must not** return.
+el3_panic(). This call **must not** return.
 
 Crash Reporting mechanism (in BL31)
 -----------------------------------
index de2b931af917c4ba588ace3ff44fd05966013c4d..cce2b9f8cc2cd75504e5d9a9f69e25d2b7f3926f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2023 Arm Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
index 9f5f7c3715f305fc4058f26e7cbcd75a855e0113..e0b3a1c67b1b6f0bfca78142c49dcfc0c4918f6f 100644 (file)
@@ -99,14 +99,14 @@ void backtrace(const char *cookie);
 #define backtrace(x)
 #endif
 
-void __dead2 do_panic(void);
+void __dead2 el3_panic(void);
 void __dead2 report_elx_panic(void);
 
 #define panic()                                \
        do {                            \
                backtrace(__func__);    \
                console_flush();        \
-               do_panic();             \
+               el3_panic();            \
        } while (false)
 
 #if CRASH_REPORTING
index 88f0a29a009a8f3ea2390a847a9639e1c4033eb5..cc5ffc0749835cbfda0a81dffd745eb94b22188e 100644 (file)
@@ -11,7 +11,7 @@
        .globl el2_panic
 
        /***********************************************************
-        * The common implementation of do_panic for all BL stages
+        * The common implementation of el3_panic for all BL stages
         ***********************************************************/
 
 .section .rodata.panic_str, "aS"
index 21c3bedafc34a855c0de50b6b38d532e5a99db7d..a7fdfa071a6a81f34c2fca794d3dd83d759ad1c1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2013-2023, Arm Limited and Contributors. All rights reserved.
  * Copyright (c) 2015-2021, Renesas Electronics Corporation. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
@@ -126,7 +126,7 @@ warm_reset:
 exit:
        ret     x9
 _panic:
-       b       do_panic
+       b       el3_panic
 #endif
 
 endfunc plat_get_my_entrypoint