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

[xen staging] include: move KB() etc to macros.h



commit 51074cf2c1544a2a294e86b81b4cf4b682aa1471
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Apr 22 08:59:53 2026 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Apr 22 08:59:53 2026 +0200

    include: move KB() etc to macros.h
    
    Allow them to be used by build tools which don't include config.h. (They
    also don't really fit into config.h, as there's nothing "configuration"
    related about them.)
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/efi/relocs-dummy.S | 1 +
 xen/include/xen/config.h        | 4 ----
 xen/include/xen/macros.h        | 4 ++++
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/efi/relocs-dummy.S b/xen/arch/x86/efi/relocs-dummy.S
index b95fa444da..1fef06ec53 100644
--- a/xen/arch/x86/efi/relocs-dummy.S
+++ b/xen/arch/x86/efi/relocs-dummy.S
@@ -1,3 +1,4 @@
+#include <xen/macros.h>
 
        .section .reloc, "a", @progbits
        .balign 4
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index 33e6aafa40..dddc8e1920 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -82,10 +82,6 @@
 #define __force
 #define __bitwise
 
-#define KB(_kb)     (_AC(_kb, ULL) << 10)
-#define MB(_mb)     (_AC(_mb, ULL) << 20)
-#define GB(_gb)     (_AC(_gb, ULL) << 30)
-
 /* allow existing code to work with Kconfig variable */
 #define NR_CPUS CONFIG_NR_CPUS
 
diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h
index acd451b335..e29cff791e 100644
--- a/xen/include/xen/macros.h
+++ b/xen/include/xen/macros.h
@@ -38,6 +38,10 @@
 #define __STR(...) #__VA_ARGS__
 #define STR(...) __STR(__VA_ARGS__)
 
+#define KB(_kb)     (_AC(_kb, ULL) << 10)
+#define MB(_mb)     (_AC(_mb, ULL) << 20)
+#define GB(_gb)     (_AC(_gb, ULL) << 30)
+
 #ifndef __ASSEMBLER__
 
 /* Force a compilation error if condition is true */
--
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®.