[PATCH 64/78] ARM: aarch64: print more information on sync exception

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On a sync exception more useful information can be printed than we
currently do. Pass the ESR and FAR value to do_sync and print the
reason for the exception along with the address that actually faulted.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 arch/arm/cpu/exceptions_64.S | 4 ++++
 arch/arm/cpu/interrupts_64.c | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/exceptions_64.S b/arch/arm/cpu/exceptions_64.S
index 58ca50b709..22034eaef9 100644
--- a/arch/arm/cpu/exceptions_64.S
+++ b/arch/arm/cpu/exceptions_64.S
@@ -35,12 +35,15 @@
 	switch_el x11, 3f, 2f, 1f
 3:	mrs	x1, esr_el3
 	mrs	x2, elr_el3
+	mrs     x3, far_el3
 	b	0f
 2:	mrs	x1, esr_el2
 	mrs	x2, elr_el2
+	mrs     x3, far_el2
 	b	0f
 1:	mrs	x1, esr_el1
 	mrs	x2, elr_el1
+	mrs     x3, far_el1
 0:
 	stp	x2, x0, [sp, #-16]!
 	mov	x0, sp
@@ -99,6 +102,7 @@ _do_bad_error:
 
 _do_sync:
 	exception_entry
+	mov	x2, x3
 	bl	do_sync
 	b	exception_exit
 
diff --git a/arch/arm/cpu/interrupts_64.c b/arch/arm/cpu/interrupts_64.c
index c32cd4f051..ee3dc3380b 100644
--- a/arch/arm/cpu/interrupts_64.c
+++ b/arch/arm/cpu/interrupts_64.c
@@ -143,9 +143,9 @@ void do_bad_error(struct pt_regs *pt_regs)
 	do_exception(pt_regs);
 }
 
-void do_sync(struct pt_regs *pt_regs)
+void do_sync(struct pt_regs *pt_regs, unsigned int esr, unsigned long far)
 {
-	printf("sync exception\n");
+	printf("%s exception at 0x%016lx\n", esr_get_class_string(esr), far);
 	do_exception(pt_regs);
 }
 
-- 
2.16.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux