bug.h 620 B

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