From 4ba4dac9589fab8357130f0341a58d465727fc23 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Wed, 22 Apr 2009 15:31:37 +0000 Subject: [PATCH] --- yaml --- r: 149631 b: refs/heads/master c: d7cb10d6d23f451eec3d1f0f4e4e8862333fa152 h: refs/heads/master i: 149629: 847cd8a3596f12d12fd1000a945d62e9399057f7 149627: f1efaca2ee3730d845e5631876a12174c9addff7 149623: b528a1d0a90a439f24dc89958074f3a946ff4303 149615: 278ac6790bbc0b0d8b66a98929613ea42cd9951a 149599: 25e0f400bcbe39b62aab2e6e768420ede1fa02ba 149567: 63098680bba74bb014081389121d656d406474e6 149503: 95bf031cb42393790ffe115e7975452420b84169 v: v3 --- [refs] | 2 +- trunk/arch/powerpc/kernel/irq.c | 31 +++++++++++++++++-------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index 1d0e3e4f1f9b..4447379c40ac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f2694ba56808a3a0fa45d9bb45289575f31e48d2 +refs/heads/master: d7cb10d6d23f451eec3d1f0f4e4e8862333fa152 diff --git a/trunk/arch/powerpc/kernel/irq.c b/trunk/arch/powerpc/kernel/irq.c index 3d3658d0b7b9..463b6ab9d6b9 100644 --- a/trunk/arch/powerpc/kernel/irq.c +++ b/trunk/arch/powerpc/kernel/irq.c @@ -301,6 +301,22 @@ static inline void handle_one_irq(unsigned int irq) } #endif +static inline void check_stack_overflow(void) +{ +#ifdef CONFIG_DEBUG_STACKOVERFLOW + long sp; + + sp = __get_SP() & (THREAD_SIZE-1); + + /* check for stack overflow: is there less than 2KB free? */ + if (unlikely(sp < (sizeof(struct thread_info) + 2048))) { + printk("do_IRQ: stack overflow: %ld\n", + sp - sizeof(struct thread_info)); + dump_stack(); + } +#endif +} + void do_IRQ(struct pt_regs *regs) { struct pt_regs *old_regs = set_irq_regs(regs); @@ -308,20 +324,7 @@ void do_IRQ(struct pt_regs *regs) irq_enter(); -#ifdef CONFIG_DEBUG_STACKOVERFLOW - /* Debugging check for stack overflow: is there less than 2KB free? */ - { - long sp; - - sp = __get_SP() & (THREAD_SIZE-1); - - if (unlikely(sp < (sizeof(struct thread_info) + 2048))) { - printk("do_IRQ: stack overflow: %ld\n", - sp - sizeof(struct thread_info)); - dump_stack(); - } - } -#endif + check_stack_overflow(); /* * Every platform is required to implement ppc_md.get_irq.