Rework use of labels in assembly macros.
This patch provides a workaround for the ASM_ASSERT label issue
and also reworks the use of labels in assembly macros.
If the caller of the ASM_ASSERT macro happened to use the
label '1' to jump past the ASM_ASSERT macro, it would not have
worked since the ASM_ASSERT macro internally used the same label.
Hence, as a workaround, this patch makes the label a high
number in the expectation that the caller will never use it.
Also updated the other assembly macros using numerical labels to
named lables.
Change-Id: Iec892359db84f2391ad2a83a92141c4d7049776a
diff --git a/include/common/assert_macros.S b/include/common/assert_macros.S
index 45d699b..807972f 100644
--- a/include/common/assert_macros.S
+++ b/include/common/assert_macros.S
@@ -30,7 +30,10 @@
/*
* Assembler macro to enable asm_assert. Use this macro wherever
- * assert is required in assembly.
+ * 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.
*/
#define ASM_ASSERT(_cc) \
.ifndef .L_assert_filename ;\
@@ -39,8 +42,8 @@
.string __FILE__ ;\
.popsection ;\
.endif ;\
- b._cc 1f ;\
+ b._cc 300f ;\
adr x0, .L_assert_filename ;\
mov x1, __LINE__ ;\
b asm_assert ;\
-1:
+300: