aboutsummaryrefslogtreecommitdiff
path: root/arch/blackfin/kernel/irqchip.c
diff options
context:
space:
mode:
authorRobin Getz <rgetz@blackfin.uclinux.org>2009-01-07 23:14:38 +0800
committerBryan Wu <cooloney@kernel.org>2009-01-07 23:14:38 +0800
commita45d575f53c9ed2926840377e59aa19e2024ee87 (patch)
tree0789f43eaee963ea5c4f4f011080b4e36a77c7eb /arch/blackfin/kernel/irqchip.c
parentf768a0eb90831ced2129df6ccba6f1177fa5a0fa (diff)
downloadlinux-2.6.38-lt-ux500-a45d575f53c9ed2926840377e59aa19e2024ee87.tar.gz
Blackfin arch: Add basic irq stack checking for Blackfin
Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/irqchip.c')
-rw-r--r--arch/blackfin/kernel/irqchip.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/blackfin/kernel/irqchip.c b/arch/blackfin/kernel/irqchip.c
index 5ad07525ea3..1624e112968 100644
--- a/arch/blackfin/kernel/irqchip.c
+++ b/arch/blackfin/kernel/irqchip.c
@@ -120,7 +120,21 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
desc = &bad_irq_desc;
irq_enter();
-
+#ifdef CONFIG_DEBUG_STACKOVERFLOW
+ /* Debugging check for stack overflow: is there less than STACK_WARN free? */
+ {
+ long sp;
+
+ sp = __get_SP() & (THREAD_SIZE-1);
+
+ if (unlikely(sp < (sizeof(struct thread_info) + STACK_WARN))) {
+ dump_stack();
+ printk(KERN_EMERG "%s: possible stack overflow while handling irq %i "
+ " only %ld bytes free\n",
+ __func__, irq, sp - sizeof(struct thread_info));
+ }
+ }
+#endif
generic_handle_irq(irq);
/* If we're the only interrupt running (ignoring IRQ15 which is for