bug.h 1002 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (C) 2006 Atmel Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #ifndef __ASM_AVR32_BUG_H
  9. #define __ASM_AVR32_BUG_H
  10. #ifdef CONFIG_BUG
  11. /*
  12. * According to our Chief Architect, this compact opcode is very
  13. * unlikely to ever be implemented.
  14. */
  15. #define AVR32_BUG_OPCODE 0x5df0
  16. #ifdef CONFIG_DEBUG_BUGVERBOSE
  17. #define BUG() \
  18. do { \
  19. asm volatile(".hword %0\n\t" \
  20. ".hword %1\n\t" \
  21. ".long %2" \
  22. : \
  23. : "n"(AVR32_BUG_OPCODE), \
  24. "i"(__LINE__), "X"(__FILE__)); \
  25. } while (0)
  26. #else
  27. #define BUG() \
  28. do { \
  29. asm volatile(".hword %0\n\t" \
  30. : : "n"(AVR32_BUG_OPCODE)); \
  31. } while (0)
  32. #endif /* CONFIG_DEBUG_BUGVERBOSE */
  33. #define HAVE_ARCH_BUG
  34. #endif /* CONFIG_BUG */
  35. #include <asm-generic/bug.h>
  36. #endif /* __ASM_AVR32_BUG_H */