blob: ab3a2ebb7053a24066e120bbaae3692996d2d399 [file] [log] [blame]
Soby Mathewd29f67b2016-05-05 12:31:57 +01001/*
2 * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
3 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Soby Mathewd29f67b2016-05-05 12:31:57 +01005 */
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00006#ifndef ASSERT_MACROS_S
7#define ASSERT_MACROS_S
Soby Mathewd29f67b2016-05-05 12:31:57 +01008
9 /*
10 * Assembler macro to enable asm_assert. We assume that the stack is
11 * initialized prior to invoking this macro.
12 */
13#define ASM_ASSERT(_cc) \
14.ifndef .L_assert_filename ;\
15 .pushsection .rodata.str1.1, "aS" ;\
16 .L_assert_filename: ;\
17 .string __FILE__ ;\
18 .popsection ;\
19.endif ;\
20 b##_cc 300f ;\
21 ldr r0, =.L_assert_filename ;\
Jeenu Viswambharanff640c42016-11-28 09:59:27 +000022 ldr r1, =__LINE__ ;\
23 b asm_assert;\
Soby Mathewd29f67b2016-05-05 12:31:57 +010024300:
25
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000026#endif /* ASSERT_MACROS_S */