summaryrefslogtreecommitdiff
path: root/arch/riscv/lib/interrupts.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-05-14 07:45:49 -0600
committerTom Rini <trini@konsulko.com>2024-05-14 07:45:49 -0600
commit676903c1b97578a82c82a40293d4939cf687d9d9 (patch)
tree9a593aaa8cd82edb4c23146ebcfdc748e2e5a484 /arch/riscv/lib/interrupts.c
parentd456f2fc54ebfa4215b310594b85b34d127c3b14 (diff)
parent2b8dc36b4c515979da330a96d9fcc9bbbe5385fa (diff)
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv
CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/20690 - RISC-V: Add NULL check after parsing compatible string - Board: Add Milk-V Mars CM board - Andes: Unify naming policy
Diffstat (limited to 'arch/riscv/lib/interrupts.c')
-rw-r--r--arch/riscv/lib/interrupts.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/arch/riscv/lib/interrupts.c b/arch/riscv/lib/interrupts.c
index 7350e2ced85..f9a1428a486 100644
--- a/arch/riscv/lib/interrupts.c
+++ b/arch/riscv/lib/interrupts.c
@@ -60,21 +60,20 @@ static void show_regs(struct pt_regs *regs)
#endif
}
-#if defined(CONFIG_FRAMEPOINTER) || defined(CONFIG_SPL_FRAMEPOINTER)
-static void show_backtrace(struct pt_regs *regs)
+static void __maybe_unused show_backtrace(struct pt_regs *regs)
{
uintptr_t *fp = (uintptr_t *)regs->s0;
unsigned count = 0;
ulong ra;
- printf("backtrace:\n");
+ printf("\nbacktrace:\n");
/* there are a few entry points where the s0 register is
* set to gd, so to avoid changing those, just abort if
* the value is the same */
while (fp != NULL && fp != (uintptr_t *)gd) {
ra = fp[-1];
- printf("backtrace %2d: FP: " REG_FMT " RA: " REG_FMT,
+ printf("%3d: FP: " REG_FMT " RA: " REG_FMT,
count, (ulong)fp, ra);
if (gd && gd->flags & GD_FLG_RELOC)
@@ -87,12 +86,6 @@ static void show_backtrace(struct pt_regs *regs)
count++;
}
}
-#else
-static void show_backtrace(struct pt_regs *regs)
-{
- printf("No backtrace support enabled\n");
-}
-#endif
/**
* instr_len() - get instruction length
@@ -165,7 +158,8 @@ static void _exit_trap(ulong code, ulong epc, ulong tval, struct pt_regs *regs)
epc - gd->reloc_off, regs->ra - gd->reloc_off);
show_regs(regs);
- show_backtrace(regs);
+ if (CONFIG_IS_ENABLED(FRAMEPOINTER))
+ show_backtrace(regs);
show_code(epc);
show_efi_loaded_images(epc);
panic("\n");