summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-03-13 21:10:10 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-03-29 08:16:40 +0200
commitfa0d6412bf1d77e383f23f120688ecf495463d1e (patch)
tree98f66fcc83f3c46634a9c1d5b54a826d701f3a82
parent03078d61a2163a69da7a59f77d28fe1a059c0a10 (diff)
downloadbarebox-fa0d6412bf1d77e383f23f120688ecf495463d1e.tar.gz
barebox-fa0d6412bf1d77e383f23f120688ecf495463d1e.tar.xz
ARM: aarch64: implement show_regs()
Do something useful in an exception and at least print the current register contents. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/cpu/interrupts_64.c8
-rw-r--r--arch/arm/include/asm/ptrace.h19
2 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/cpu/interrupts_64.c b/arch/arm/cpu/interrupts_64.c
index b3bd0aa5a4..ffdb87af94 100644
--- a/arch/arm/cpu/interrupts_64.c
+++ b/arch/arm/cpu/interrupts_64.c
@@ -30,6 +30,14 @@
*/
void show_regs(struct pt_regs *regs)
{
+ int i;
+
+ printf("elr: %016lx lr : %016lx\n", regs->elr, regs->regs[30]);
+
+ for (i = 0; i < 29; i += 2)
+ printf("x%-2d: %016lx x%-2d: %016lx\n",
+ i, regs->regs[i], i + 1, regs->regs[i + 1]);
+ printf("\n");
}
static void __noreturn do_exception(struct pt_regs *pt_regs)
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
index 6520a0a73a..7fbd8d9b6f 100644
--- a/arch/arm/include/asm/ptrace.h
+++ b/arch/arm/include/asm/ptrace.h
@@ -10,6 +10,23 @@
#ifndef __ASM_ARM_PTRACE_H
#define __ASM_ARM_PTRACE_H
+#ifdef CONFIG_CPU_64
+
+#ifndef __ASSEMBLY__
+
+/*
+ * This struct defines the way the registers are stored
+ * on the stack during an exception.
+ */
+struct pt_regs {
+ unsigned long elr;
+ unsigned long regs[31];
+};
+
+#endif /* __ASSEMBLY__ */
+
+#else /* CONFIG_CPU_64 */
+
#define PTRACE_GETREGS 12
#define PTRACE_SETREGS 13
#define PTRACE_GETFPREGS 14
@@ -141,4 +158,6 @@ extern void show_regs(struct pt_regs *);
#endif /* __ASSEMBLY__ */
+#endif /* CONFIG_CPU_64 */
+
#endif