Re: [PATCH v3] mips: irq: add stackoverflow detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 06, 2010 at 02:53:43PM +0400, Sergei Shtylyov wrote:

> >Add stackoverflow detection to mips arch
> 
>    There's no such word: stackoverflow. Space is needed.
> 
> >This is the 3rd version of the smiple patch. 2K is too big for many
> >system, so I Modified the warning line by following Ralf's suggestion.
> 
> >Signed-off-by: Adam Jiang<jiang.adam@xxxxxxxxx>
> [...]
> 
> >diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
> >index c6345f5..b43edb7 100644
> >--- a/arch/mips/kernel/irq.c
> >+++ b/arch/mips/kernel/irq.c
> >@@ -151,6 +151,28 @@ void __init init_IRQ(void)
> >  #endif
> >  }
> >
> >+#ifdef CONFIG_DEBUG_STACKOVERFLOW
> >+static inline void check_stack_overflow(void)
> >+{
> >+	unsigned long sp;
> >+
> >+	asm volatile("move %0, $sp" : "=r" (sp));
> >+	sp = sp & THREAD_MASK;
> 
>    Why not:
> 
> 	sp &= THREAD_MASK;
> 
>    It's C, after all! :-)

I already had accepted his previous version with minor changes so I've
combined the two.

Thanks Adam!

  Ralf



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux