assert_macros.S 587 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef ASSERT_MACROS_S
  7. #define ASSERT_MACROS_S
  8. /*
  9. * Assembler macro to enable asm_assert. We assume that the stack is
  10. * initialized prior to invoking this macro.
  11. */
  12. #define ASM_ASSERT(_cc) \
  13. .ifndef .L_assert_filename ;\
  14. .pushsection .rodata.str1.1, "aS" ;\
  15. .L_assert_filename: ;\
  16. .string __FILE__ ;\
  17. .popsection ;\
  18. .endif ;\
  19. b##_cc 300f ;\
  20. ldr r0, =.L_assert_filename ;\
  21. ldr r1, =__LINE__ ;\
  22. b asm_assert;\
  23. 300:
  24. #endif /* ASSERT_MACROS_S */