2014-07-14 16:58:03 +01:00
|
|
|
/*
|
2016-03-24 16:56:29 +00:00
|
|
|
* Copyright (c) 2014-2016, ARM Limited and Contributors. All rights reserved.
|
2014-07-14 16:58:03 +01:00
|
|
|
*
|
2017-05-03 09:38:09 +01:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2014-07-14 16:58:03 +01:00
|
|
|
*/
|
2018-11-08 10:20:19 +00:00
|
|
|
#ifndef ASSERT_MACROS_S
|
|
|
|
#define ASSERT_MACROS_S
|
2014-07-14 16:58:03 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Assembler macro to enable asm_assert. Use this macro wherever
|
2014-08-19 11:26:00 +01:00
|
|
|
* assert is required in assembly. Please note that the macro makes
|
|
|
|
* use of label '300' to provide the logic and the caller
|
|
|
|
* should make sure that this label is not used to branch prior
|
|
|
|
* to calling this macro.
|
2014-07-14 16:58:03 +01:00
|
|
|
*/
|
|
|
|
#define ASM_ASSERT(_cc) \
|
|
|
|
.ifndef .L_assert_filename ;\
|
|
|
|
.pushsection .rodata.str1.1, "aS" ;\
|
|
|
|
.L_assert_filename: ;\
|
|
|
|
.string __FILE__ ;\
|
|
|
|
.popsection ;\
|
|
|
|
.endif ;\
|
2014-08-19 11:26:00 +01:00
|
|
|
b._cc 300f ;\
|
2014-07-14 16:58:03 +01:00
|
|
|
adr x0, .L_assert_filename ;\
|
|
|
|
mov x1, __LINE__ ;\
|
|
|
|
b asm_assert ;\
|
2014-08-19 11:26:00 +01:00
|
|
|
300:
|
2015-04-01 17:34:24 +01:00
|
|
|
|
2018-11-08 10:20:19 +00:00
|
|
|
#endif /* ASSERT_MACROS_S */
|