halt/reset on assert?

Evan Lavelle sa212+lppc at cyconix.com
Sat Apr 2 11:22:52 EST 2011

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 -


More information about the Linuxppc-dev mailing list