summaryrefslogtreecommitdiff
path: root/include/lib
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-07-18 11:56:00 +0100
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-07-20 11:36:00 +0100
commit029f5a28a8dd016e207f1c81bc961674d1528404 (patch)
tree7509d609b65363fcd4671f1496f2a54fb32506a6 /include/lib
parentba0248b52d8027e0f38cf44353f8860bbf171b2d (diff)
Introduce UL(), L() and LL() macros
utils_def.h already has U() and ULL(), but not UL(), which is needed for types like uinptr_t and u_register_t. Also added L() and LL() for signed values. Change-Id: I0654df80d57149ff49507c52f1b27f3d500486a0 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'include/lib')
-rw-r--r--include/lib/utils_def.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/include/lib/utils_def.h b/include/lib/utils_def.h
index 1bdf3c4b..6bc97065 100644
--- a/include/lib/utils_def.h
+++ b/include/lib/utils_def.h
@@ -99,20 +99,26 @@
((u32) > (UINT32_MAX - (inc)) ? 1 : 0)
/*
- * For those constants to be shared between C and other sources, apply a 'u'
- * or 'ull' suffix to the argument only in C, to avoid undefined or unintended
- * behaviour.
+ * For those constants to be shared between C and other sources, apply a 'U',
+ * 'UL', 'ULL', 'L' or 'LL' suffix to the argument only in C, to avoid
+ * undefined or unintended behaviour.
*
- * The GNU assembler and linker do not support the 'u' and 'ull' suffix (it
- * causes the build process to fail) therefore the suffix is omitted when used
- * in linker scripts and assembler files.
+ * The GNU assembler and linker do not support these suffixes (it causes the
+ * build process to fail) therefore the suffix is omitted when used in linker
+ * scripts and assembler files.
*/
#if defined(__LINKER__) || defined(__ASSEMBLY__)
-# define U(_x) (_x)
+# define U(_x) (_x)
+# define UL(_x) (_x)
# define ULL(_x) (_x)
+# define L(_x) (_x)
+# define LL(_x) (_x)
#else
-# define U(_x) (_x##U)
+# define U(_x) (_x##U)
+# define UL(_x) (_x##UL)
# define ULL(_x) (_x##ULL)
+# define L(_x) (_x##L)
+# define LL(_x) (_x##LL)
#endif
/* Register size of the current architecture. */