Soby Mathew | d29f67b | 2016-05-05 12:31:57 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Soby Mathew | d29f67b | 2016-05-05 12:31:57 +0100 | [diff] [blame] | 5 | */ |
| 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 Viswambharan | ff640c4 | 2016-11-28 09:59:27 +0000 | [diff] [blame] | 22 | ldr r1, =__LINE__ ;\ |
| 23 | b asm_assert;\ |
Soby Mathew | d29f67b | 2016-05-05 12:31:57 +0100 | [diff] [blame] | 24 | 300: |
| 25 | |
| 26 | #endif /* __ASSERT_MACROS_S__ */ |