All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Evan Lavelle <sa212+lppc@cyconix.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: halt/reset on assert?
Date: Sat, 02 Apr 2011 08:51:37 +0200	[thread overview]
Message-ID: <m2wrjduow6.fsf@igel.home> (raw)
In-Reply-To: <4D966C5C.9030409__15236.8285613649$1301704900$gmane$org@cyconix.com> (Evan Lavelle's message of "Sat, 02 Apr 2011 01:22:52 +0100")

Evan Lavelle <sa212+lppc@cyconix.com> writes:

> I'd like to use an assert macro in a device driver for an MPC870 using
> ppcboot; something like:
>
> #define MY_ASSERT(expr)                                         \
>    do {                                                         \
>       if(!(expr)) {                                             \
>          printk(                                                \
>             KERN_EMERG                                          \
>             "assertion failure: %s, line %d\n",                 \
>             __FILE__, __LINE__);                                \
>          asm(--ppc halt/reset?)                                 \
>       }                                                         \
>    } while(0)
>
> However, I've got no idea how to halt or reset the processor here. Anyone
> happen to know?

#define MY_ASSERT(expr) BUG(!(expr))

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

       reply	other threads:[~2011-04-02  6:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4D966C5C.9030409__15236.8285613649$1301704900$gmane$org@cyconix.com>
2011-04-02  6:51 ` Andreas Schwab [this message]
2011-04-02  6:53 ` halt/reset on assert? Andreas Schwab
2011-04-06 13:01   ` Evan Lavelle
2011-04-07  7:55     ` Benjamin Herrenschmidt
2011-04-07 17:04       ` kevin diggs
2011-04-07 21:48         ` Benjamin Herrenschmidt
2011-04-02  0:22 Evan Lavelle

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=m2wrjduow6.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=sa212+lppc@cyconix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.