bug.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * include/asm-xtensa/bug.h
  3. *
  4. * Macros to cause a 'bug' message.
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. *
  10. * Copyright (C) 2001 - 2005 Tensilica Inc.
  11. */
  12. #ifndef _XTENSA_BUG_H
  13. #define _XTENSA_BUG_H
  14. #include <linux/stringify.h>
  15. #define ILL __asm__ __volatile__ (".byte 0,0,0\n")
  16. #ifdef CONFIG_KALLSYMS
  17. # define BUG() do { \
  18. printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
  19. ILL; \
  20. } while (0)
  21. #else
  22. # define BUG() do { \
  23. printk("kernel BUG!\n"); \
  24. ILL; \
  25. } while (0)
  26. #endif
  27. #define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
  28. #define PAGE_BUG(page) do { BUG(); } while (0)
  29. #define WARN_ON(condition) do { \
  30. if (unlikely((condition)!=0)) { \
  31. printk ("Warning in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
  32. dump_stack(); \
  33. } \
  34. } while (0)
  35. #endif /* _XTENSA_BUG_H */