asm-bug.h 935 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. #ifndef __ASM_ASM_BUG_H
  3. /*
  4. * Copyright (C) 2017 ARM Limited
  5. */
  6. #define __ASM_ASM_BUG_H
  7. #include <asm/brk-imm.h>
  8. #ifdef CONFIG_DEBUG_BUGVERBOSE
  9. #define _BUGVERBOSE_LOCATION(file, line) __BUGVERBOSE_LOCATION(file, line)
  10. #define __BUGVERBOSE_LOCATION(file, line) \
  11. .pushsection .rodata.str,"aMS",@progbits,1; \
  12. 14472: .string file; \
  13. .popsection; \
  14. \
  15. .long 14472b - .; \
  16. .short line;
  17. #else
  18. #define _BUGVERBOSE_LOCATION(file, line)
  19. #endif
  20. #ifdef CONFIG_GENERIC_BUG
  21. #define __BUG_ENTRY(flags) \
  22. .pushsection __bug_table,"aw"; \
  23. .align 2; \
  24. 14470: .long 14471f - .; \
  25. _BUGVERBOSE_LOCATION(__FILE__, __LINE__) \
  26. .short flags; \
  27. .popsection; \
  28. 14471:
  29. #else
  30. #define __BUG_ENTRY(flags)
  31. #endif
  32. #define ASM_BUG_FLAGS(flags) \
  33. __BUG_ENTRY(flags) \
  34. brk BUG_BRK_IMM
  35. #define ASM_BUG() ASM_BUG_FLAGS(0)
  36. #endif /* __ASM_ASM_BUG_H */