From: Lothar Waßmann Date: Wed, 8 Mar 2017 15:13:38 +0000 (+0100) Subject: arm64: print pre-relocation addresses in register dump X-Git-Tag: KARO-TXSD-2017-03-15~21 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;ds=sidebyside;h=e59fa8752f58a4742308b28870ebf19c9112745d;p=karo-tx-uboot.git arm64: print pre-relocation addresses in register dump The addresses in ELR and LR are not meaningful after relocation of U-Boot. Print the pre-relocation values that can easily be matched with the source code in the register dump. --- diff --git a/arch/arm/lib/interrupts_64.c b/arch/arm/lib/interrupts_64.c index 7c9cfce69f..1780782215 100644 --- a/arch/arm/lib/interrupts_64.c +++ b/arch/arm/lib/interrupts_64.c @@ -9,6 +9,7 @@ #include #include +DECLARE_GLOBAL_DATA_PTR; int interrupt_init(void) { @@ -29,8 +30,15 @@ void show_regs(struct pt_regs *regs) { int i; - printf("ELR: %lx\n", regs->elr); - printf("LR: %lx\n", regs->regs[30]); + if (gd->flags & GD_FLG_RELOC) { + printf("ELR: %08lx (pre-reloc: %08lx)\n", + regs->elr, regs->elr - gd->reloc_off); + printf("LR: %08lx (pre-reloc: %08lx)\n", + regs->regs[30], regs->regs[30] - gd->reloc_off); + } else { + printf("ELR: %08lx\n", regs->elr); + printf("LR: %08lx\n", 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]);