aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/arm/faults.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm/arm/faults.c b/arch/arm/arm/faults.c
index 85718d4b..a80d7af1 100644
--- a/arch/arm/arm/faults.c
+++ b/arch/arm/arm/faults.c
@@ -87,8 +87,12 @@ static void dump_mode_regs(uint32_t spsr, uint32_t svc_r13, uint32_t svc_r14)
}
if (stack != 0) {
- dprintf(CRITICAL, "bottom of stack at 0x%08x:\n", (unsigned int)stack);
- hexdump((void *)stack, 128);
+ dprintf(CRITICAL, "stack pointer at 0x%08x:\n", (unsigned int)stack);
+
+ /* Avoid crossing page-boundary in case near stack base */
+ const size_t used_stack = PAGE_SIZE - ((unsigned int)stack % PAGE_SIZE);
+
+ hexdump((void *)stack, MIN(used_stack, 128));
}
}