bug.h 594 B

123456789101112131415161718192021222324252627
  1. #ifndef __ASM_SH64_BUG_H
  2. #define __ASM_SH64_BUG_H
  3. /*
  4. * Tell the user there is some problem, then force a segfault (in process
  5. * context) or a panic (interrupt context).
  6. */
  7. #define BUG() do { \
  8. printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
  9. *(volatile int *)0 = 0; \
  10. } while (0)
  11. #define BUG_ON(condition) do { \
  12. if (unlikely((condition)!=0)) \
  13. BUG(); \
  14. } while(0)
  15. #define WARN_ON(condition) do { \
  16. if (unlikely((condition)!=0)) { \
  17. printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
  18. dump_stack(); \
  19. } \
  20. } while (0)
  21. #endif /* __ASM_SH64_BUG_H */