All of lore.kernel.org
 help / color / mirror / Atom feed
From: Evan Lavelle <sa212+lppc@cyconix.com>
To: linuxppc-dev@lists.ozlabs.org
Subject: halt/reset on assert?
Date: Sat, 02 Apr 2011 01:22:52 +0100	[thread overview]
Message-ID: <4D966C5C.9030409@cyconix.com> (raw)

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?

Thanks -

Evan

             reply	other threads:[~2011-04-02  0:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-02  0:22 Evan Lavelle [this message]
     [not found] <4D966C5C.9030409__15236.8285613649$1301704900$gmane$org@cyconix.com>
2011-04-02  6:51 ` halt/reset on assert? Andreas Schwab
2011-04-02  6:53 ` 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

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=4D966C5C.9030409@cyconix.com \
    --to=sa212+lppc@cyconix.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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.