[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] include: move STR() and IS_ALIGNED()



commit 472839e61c7c2a8a5d8221834761de85e745ae33
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Apr 5 11:39:12 2022 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Apr 5 11:39:12 2022 +0200

    include: move STR() and IS_ALIGNED()
    
    lib.h is imo a better fit for them than config.h.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/arm/xen.lds.S   | 1 +
 xen/arch/x86/xen.lds.S   | 1 +
 xen/include/xen/config.h | 5 -----
 xen/include/xen/lib.h    | 5 +++++
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index 7921d8fa28..ad7f966f0e 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -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
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 3f9f633f55..6926e88e54 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -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
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index b76222ecf6..85c6f59be9 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -82,11 +82,6 @@
 #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
 
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index b9b24a0436..aab1fc7c4a 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -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>
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.