]> xenbits.xensource.com Git - people/tklengyel/xen.git/commitdiff
include: move STR() and IS_ALIGNED()
authorJan Beulich <jbeulich@suse.com>
Tue, 5 Apr 2022 09:39:12 +0000 (11:39 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Apr 2022 09:39:12 +0000 (11:39 +0200)
lib.h is imo a better fit for them than config.h.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/arm/xen.lds.S
xen/arch/x86/xen.lds.S
xen/include/xen/config.h
xen/include/xen/lib.h

index 7921d8fa2888a2c9f9745b5ceb3369802755f976..ad7f966f0ee5564d08fd338f5deabb9e64f55f80 100644 (file)
@@ -3,6 +3,7 @@
 /* Modified for ARM Xen by Ian Campbell */
 
 #include <xen/cache.h>
+#include <xen/lib.h>
 #include <asm/page.h>
 #undef ENTRY
 #undef ALIGN
index 3f9f633f55724a95c21250f317959317dffa37c4..6926e88e54f6885906ce2cdddbd0ff2e872ae991 100644 (file)
@@ -2,6 +2,7 @@
 /* Modified for i386/x86-64 Xen by Keir Fraser */
 
 #include <xen/cache.h>
+#include <xen/lib.h>
 #include <asm/page.h>
 #undef ENTRY
 #undef ALIGN
index b76222ecf6defff8896e63b35d29af38fa4766d1..85c6f59be90709969e8ec1d26fc024cb12968ec5 100644 (file)
 #define MB(_mb)     (_AC(_mb, ULL) << 20)
 #define GB(_gb)     (_AC(_gb, ULL) << 30)
 
-#define IS_ALIGNED(val, align) (((val) & ((align) - 1)) == 0)
-
-#define __STR(...) #__VA_ARGS__
-#define STR(...) __STR(__VA_ARGS__)
-
 /* allow existing code to work with Kconfig variable */
 #define NR_CPUS CONFIG_NR_CPUS
 
index b9b24a04362943beb1841ee88bd6d029be51b367..aab1fc7c4a6968becaf9ca0cb0e4dd52f68dca36 100644 (file)
@@ -3,6 +3,8 @@
 
 #define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
 
+#define IS_ALIGNED(val, align) (!((val) & ((align) - 1)))
+
 #define DIV_ROUND(n, d) (((n) + (d) / 2) / (d))
 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
 
@@ -17,6 +19,9 @@
 #define PASTE_(a, b) a ## b
 #define PASTE(a, b) PASTE_(a, b)
 
+#define __STR(...) #__VA_ARGS__
+#define STR(...) __STR(__VA_ARGS__)
+
 #ifndef __ASSEMBLY__
 
 #include <xen/inttypes.h>