Remove dead loops in assert() in C and ASM
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>
Thu, 16 Feb 2017 16:49:18 +0000 (16:49 +0000)
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>
Fri, 31 Mar 2017 08:54:22 +0000 (09:54 +0100)
The desired behaviour is to call `plat_panic_handler()`, and to use
`no_ret` to do so from ASM.

Change-Id: I88b2feefa6e6c8f9bf057fd51ee0d2e9fb551e4f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
common/aarch32/debug.S
common/aarch64/debug.S
lib/stdlib/assert.c

index 504da248ac24d1b98806526a4cc8f662db650e59..77298a12e6aa07247033f4f015dc0b7383c64fb1 100644 (file)
@@ -75,7 +75,7 @@ func do_panic
 
 1:
        mov     lr, r6
-       b       plat_panic_handler
+       no_ret  plat_panic_handler
 endfunc do_panic
 
        /***********************************************************
index 10818421df815c4aabf061b38988d30709e16938..fb6924ea19c75de065faffbfeded7a172ce9bc6b 100644 (file)
@@ -98,7 +98,7 @@ func asm_assert
        asm_print_line_dec
        bl      plat_crash_console_flush
 _assert_loop:
-       b       _assert_loop
+       no_ret  plat_panic_handler
 endfunc asm_assert
 #endif
 
index cb3f3550eabaf3e73213b7b24bdc776be5755159..3486e50b1549f077868734c44a1f8b2b006a61dd 100644 (file)
@@ -42,5 +42,5 @@ void __assert (const char *function, const char *file, unsigned int line,
 
        console_flush();
 
-       while(1);
+       plat_panic_handler();
 }