[Top] [All Lists]

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

To: Adam Jiang <>
Subject: Re: [PATCH v3] mips: irq: add stackoverflow detection
From: Sergei Shtylyov <>
Date: Wed, 06 Oct 2010 14:53:43 +0400
In-reply-to: <>
Original-recipient: rfc822;
References: <>
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv: Gecko/20100915 Thunderbird/3.1.4

On 06-10-2010 14:41, Adam Jiang 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<>

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)

+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! :-)

WBR, Sergei

<Prev in Thread] Current Thread [Next in Thread>