asm-bug.h 952 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. .align 2; \
  28. .popsection; \
  29. 14471:
  30. #else
  31. #define __BUG_ENTRY(flags)
  32. #endif
  33. #define ASM_BUG_FLAGS(flags) \
  34. __BUG_ENTRY(flags) \
  35. brk BUG_BRK_IMM
  36. #define ASM_BUG() ASM_BUG_FLAGS(0)
  37. #endif /* __ASM_ASM_BUG_H */