blob: c9588106d2f053c1f810b6845c0b9ff8d1768bf9 [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 */
6#ifndef __ASSERT_MACROS_S__
7#define __ASSERT_MACROS_S__
8
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
26#endif /* __ASSERT_MACROS_S__ */