bug.h 673 B

1234567891011121314151617181920212223242526272829303132
  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 PAGE_BUG(page) do { \
  17. BUG(); \
  18. } while (0)
  19. #define WARN_ON(condition) do { \
  20. if (unlikely((condition)!=0)) { \
  21. printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
  22. dump_stack(); \
  23. } \
  24. } while (0)
  25. #endif /* __ASM_SH64_BUG_H */