summaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2017-01-10 08:19:21 -0500
committerTom Rini <trini@konsulko.com>2017-01-10 08:19:21 -0500
commit0b8404332ed08799ca0630e4cc868df039f206e3 (patch)
treec5d4e2c1f963b5716ae9dd7024dce5341feb6856 /include/common.h
parenta705ebc81b7f91bbd0ef7c634284208342901149 (diff)
parenteb77f5c9f69ef6c8cb39643b7b7107ef7bff5305 (diff)
Merge branch 'master' of git://git.denx.de/u-boot-sunxi
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/common.h b/include/common.h
index a8d833b9891..ee0436bff55 100644
--- a/include/common.h
+++ b/include/common.h
@@ -15,6 +15,9 @@ typedef volatile unsigned long vu_long;
typedef volatile unsigned short vu_short;
typedef volatile unsigned char vu_char;
+/* Allow sharing constants with type modifiers between C and assembly. */
+#define _AC(X, Y) (X##Y)
+
#include <config.h>
#include <errno.h>
#include <asm-offsets.h>
@@ -936,7 +939,12 @@ int cpu_disable(int nr);
int cpu_release(int nr, int argc, char * const argv[]);
#endif
-#endif /* __ASSEMBLY__ */
+#else /* __ASSEMBLY__ */
+
+/* Drop a C type modifier (like in 3UL) for constants used in assembly. */
+#define _AC(X, Y) X
+
+#endif /* __ASSEMBLY__ */
#ifdef CONFIG_PPC
/*
@@ -948,6 +956,9 @@ int cpu_release(int nr, int argc, char * const argv[]);
/* Put only stuff here that the assembler can digest */
+/* Declare an unsigned long constant digestable both by C and an assembler. */
+#define UL(x) _AC(x, UL)
+
#ifdef CONFIG_POST
#define CONFIG_HAS_POST
#ifndef CONFIG_POST_ALT_LIST