refactor(bl31): use elx_panic for sysreg_handler64

When we reach sysreg_handler64 from any trap handling we are entering
this path from lower EL and thus we should be calling lower_el_panic
reporting mechanism to print panic report.

Make report_elx_panic available through assembly func elx_panic which
could be used for reporting any lower_el_panic.

Change-Id: Ieb260cf20ea327a59db84198b2c6a6bfc9ca9537
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
diff --git a/common/aarch64/debug.S b/common/aarch64/debug.S
index 82d57d7..8768a1f 100644
--- a/common/aarch64/debug.S
+++ b/common/aarch64/debug.S
@@ -14,6 +14,7 @@
 	.globl	asm_print_newline
 	.globl	asm_assert
 	.globl	el3_panic
+	.globl	elx_panic
 
 /* Since the max decimal input number is 65536 */
 #define MAX_DEC_DIVISOR		10000
@@ -151,6 +152,14 @@
 .section .rodata.panic_str, "aS"
 	panic_msg: .asciz "PANIC at PC : 0x"
 
+func elx_panic
+#if CRASH_REPORTING && defined(IMAGE_BL31)
+	b	report_elx_panic
+#endif /* CRASH_REPORTING && IMAGE_BL31 */
+
+	b	panic_common
+endfunc elx_panic
+
 /* ---------------------------------------------------------------------------
  * el3_panic assumes that it is invoked from a C Runtime Environment ie a
  * valid stack exists. This call will not return.
@@ -163,6 +172,7 @@
 	b	report_el3_panic
 #endif /* CRASH_REPORTING && IMAGE_BL31 */
 
+panic_common:
 	mov	x6, x30
 	bl	plat_crash_console_init
 
@@ -189,4 +199,4 @@
 	mov	x30, x6
 	b	plat_panic_handler
 
-endfunc el3_panic
\ No newline at end of file
+endfunc el3_panic