]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
tools: Move MB/GB() to common-macros.h
authorJason Andryuk <jason.andryuk@amd.com>
Thu, 4 Apr 2024 10:01:13 +0000 (12:01 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 4 Apr 2024 10:01:13 +0000 (12:01 +0200)
Consolidate to a single set of common macros for tools.

MB() will gain another use in libelf, so this movement makes it
available.

Requested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
tools/firmware/hvmloader/util.h
tools/helpers/init-xenstore-domain.c
tools/include/xen-tools/common-macros.h
tools/libs/light/libxl_internal.h

index 87be213dec283e4064027f0155e49c3fcdf912d6..14078bde1e30a693801e46560b62e34c9d937df2 100644 (file)
@@ -38,9 +38,6 @@ void __bug(const char *file, int line) __attribute__((noreturn));
 #define BUG() __bug(__FILE__, __LINE__)
 #define BUG_ON(p) do { if (p) BUG(); } while (0)
 
-#define MB(mb) (mb##ULL << 20)
-#define GB(gb) (gb##ULL << 30)
-
 static inline int test_bit(unsigned int b, const void *p)
 {
     return !!(((const uint8_t *)p)[b>>3] & (1u<<(b&7)));
index 73325457709bab5b2d2a471ad260d52d20842086..01ca667d25d15032e9acaff025e83b80aefd2ecb 100644 (file)
@@ -20,7 +20,6 @@
 #include "init-dom-json.h"
 
 #define LAPIC_BASE_ADDRESS  0xfee00000UL
-#define GB(x)               ((uint64_t)x << 30)
 
 static uint32_t domid = ~0;
 static char *kernel;
index 81fba2e9f5bfd094e4f42d2de5bdd9ade725808b..07aed92684b502ec01039401793f0fd7edf1eea7 100644 (file)
 #define __AC(X, Y)   (X ## Y)
 #define _AC(X, Y)    __AC(X, Y)
 
+/* Size macros. */
+#define MB(_mb)     (_AC(_mb, ULL) << 20)
+#define GB(_gb)     (_AC(_gb, ULL) << 30)
+
 #define get_unaligned_t(type, ptr) ({                               \
     const struct { type x; } __packed *ptr_ = (typeof(ptr_))(ptr);  \
     ptr_->x;                                                        \
index 094d0df9b167335a9417d02f6e02b1ec5f62eeea..803dbc1a03ba0ede714b193433710ae4dbfadc5e 100644 (file)
 #define PVSHIM_BASENAME "xen-shim"
 #define PVSHIM_CMDLINE "pv-shim console=xen,pv"
 
-/* Size macros. */
-#define MB(_mb)     (_AC(_mb, ULL) << 20)
-#define GB(_gb)     (_AC(_gb, ULL) << 30)
-
 #define DIV_ROUNDUP(n, d) (((n) + (d) - 1) / (d))
 
 #define LIBXL__LOGGING_ENABLED