aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu/kernel/traps.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 12:17:19 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 12:17:19 -0700
commit3fde80e94c2bbffbb13f5faa3340cf438440ebea (patch)
tree43eeac74dc34596772b9d9883e9208da8ae84184 /arch/m68knommu/kernel/traps.c
parentMerge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight (diff)
parentm68knommu: put ColdFire head code into .text.head section (diff)
downloadlinux-dev-3fde80e94c2bbffbb13f5faa3340cf438440ebea.tar.xz
linux-dev-3fde80e94c2bbffbb13f5faa3340cf438440ebea.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68knommu: put ColdFire head code into .text.head section m68knommu: remove last use of CONFIG_FADS and CONFIG_RPXCLASSIC m68knommu: remove RPXCLASSIC from the m68k tree m68knommu: fec: remove FADS m68knommu: MCF5307 PIT GENERIC_CLOCKEVENTS support m68knommu: add read_barrier_depends() and irqs_disabled_flags() m68knommu: add byteswap assembly opcode for ISA A+ m68knommu: add ffs and __ffs plattform which support ISA A+ or ISA C m68knommu: add sched_clock() for the DMA timer m68knommu: complete generic time m68knommu: move code within time.c m68knommu: m68knommu: add old stack trace method m68knommu: Add Coldfire DMA Timer support m68knommu: defconfig for M5407C3 board m68knommu: defconfig for M5307C3 board m68knommu: defconfig for M5275EVB board m68knommu: defconfig for M5249EVB board m68knommu: change to a configs directory for board configurations
Diffstat (limited to 'arch/m68knommu/kernel/traps.c')
-rw-r--r--arch/m68knommu/kernel/traps.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/arch/m68knommu/kernel/traps.c b/arch/m68knommu/kernel/traps.c
index ec9aea652e79..46f8f9d0c408 100644
--- a/arch/m68knommu/kernel/traps.c
+++ b/arch/m68knommu/kernel/traps.c
@@ -103,12 +103,28 @@ asmlinkage void buserr_c(struct frame *fp)
force_sig(SIGSEGV, current);
}
+static void print_this_address(unsigned long addr, int i)
+{
+#ifdef CONFIG_KALLSYMS
+ printk(KERN_EMERG " [%08lx] ", addr);
+ print_symbol(KERN_CONT "%s\n", addr);
+#else
+ if (i % 5)
+ printk(KERN_CONT " [%08lx] ", addr);
+ else
+ printk(KERN_CONT "\n" KERN_EMERG " [%08lx] ", addr);
+ i++;
+#endif
+}
+
int kstack_depth_to_print = 48;
static void __show_stack(struct task_struct *task, unsigned long *stack)
{
unsigned long *endstack, addr;
+#ifdef CONFIG_FRAME_POINTER
unsigned long *last_stack;
+#endif
int i;
if (!stack)
@@ -126,6 +142,7 @@ static void __show_stack(struct task_struct *task, unsigned long *stack)
printk(" %08lx", *(stack + i));
}
printk("\n");
+ i = 0;
#ifdef CONFIG_FRAME_POINTER
printk(KERN_EMERG "Call Trace:\n");
@@ -134,15 +151,30 @@ static void __show_stack(struct task_struct *task, unsigned long *stack)
while (stack <= endstack && stack > last_stack) {
addr = *(stack + 1);
- printk(KERN_EMERG " [%08lx] ", addr);
- print_symbol(KERN_CONT "%s\n", addr);
+ print_this_address(addr, i);
+ i++;
last_stack = stack;
stack = (unsigned long *)*stack;
}
printk("\n");
#else
- printk(KERN_EMERG "CONFIG_FRAME_POINTER disabled, no symbolic call trace\n");
+ printk(KERN_EMERG "Call Trace with CONFIG_FRAME_POINTER disabled:\n");
+ while (stack <= endstack) {
+ addr = *stack++;
+ /*
+ * If the address is either in the text segment of the kernel,
+ * or in a region which is occupied by a module then it *may*
+ * be the address of a calling routine; if so, print it so that
+ * someone tracing down the cause of the crash will be able to
+ * figure out the call path that was taken.
+ */
+ if (__kernel_text_address(addr)) {
+ print_this_address(addr, i);
+ i++;
+ }
+ }
+ printk(KERN_CONT "\n");
#endif
}