1 /* 2 * Copyright (c) 2014-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 /* 10 * Assembler macro to enable asm_assert. Use this macro wherever 11 * assert is required in assembly. Please note that the macro makes 12 * use of label '300' to provide the logic and the caller 13 * should make sure that this label is not used to branch prior 14 * to calling this macro. 15 */ 16 #define ASM_ASSERT(_cc) \ 17 .ifndef .L_assert_filename ;\ 18 .pushsection .rodata.str1.1, "aS" ;\ 19 .L_assert_filename: ;\ 20 .string __FILE__ ;\ 21 .popsection ;\ 22 .endif ;\ 23 b._cc 300f ;\ 24 adr x0, .L_assert_filename ;\ 25 mov x1, __LINE__ ;\ 26 b asm_assert ;\ 27 300: 28 29 #endif /* __ASSERT_MACROS_S__ */ 30