Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Adam Jiang <jiang.adam@gmail.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] mips: irq: add stackoverflow detection
Date: Thu, 7 Oct 2010 00:25:54 +0900	[thread overview]
Message-ID: <20101006152554.GC13400@capricorn-x61> (raw)
In-Reply-To: <20101006112114.GA19856@linux-mips.org>

On Wed, Oct 06, 2010 at 12:21:15PM +0100, Ralf Baechle wrote:
> 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@gmail.com>
> > [...]
> > 
> > >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 Ralf. I am very glad I can do this small piece of code for Linux
kernel, though with many faults. :) No doubt I will try to do much more
then.

Best regards,
/Adam

      reply	other threads:[~2010-10-06 15:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-06 10:41 [PATCH v3] mips: irq: add stackoverflow detection Adam Jiang
2010-10-06 10:53 ` Sergei Shtylyov
2010-10-06 11:21   ` Ralf Baechle
2010-10-06 15:25     ` Adam Jiang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101006152554.GC13400@capricorn-x61 \
    --to=jiang.adam@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=sshtylyov@mvista.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox