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

[Xen-devel] [RFC PATCH V4 14/18] Introduce EVTCHN_WORD_BITORDER macro



This macro is used to optimise calculation.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 xen/include/asm-arm/config.h |    1 +
 xen/include/asm-x86/config.h |    5 ++++-
 xen/include/xen/event.h      |    2 ++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 8be8563..3ba7df7 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -24,6 +24,7 @@
 
 /* xen_ulong_t is always 64 bits */
 #define BITS_PER_XEN_ULONG 64
+#define XEN_ULONG_BITORDER 6
 
 #define CONFIG_PAGING_ASSISTANCE 1
 
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index cf93bd5..a43810d 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -8,13 +8,16 @@
 #define __X86_CONFIG_H__
 
 #define LONG_BYTEORDER 3
+#define BYTE_BITORDER 3
+#define LONG_BITORDER (BYTE_BITORDER + LONG_BYTEORDER)
 #define CONFIG_PAGING_LEVELS 4
 
 #define BYTES_PER_LONG (1 << LONG_BYTEORDER)
 #define BITS_PER_LONG (BYTES_PER_LONG << 3)
-#define BITS_PER_BYTE 8
+#define BITS_PER_BYTE (1 << BYTE_BITORDER)
 
 #define BITS_PER_XEN_ULONG BITS_PER_LONG
+#define XEN_ULONG_BITORDER LONG_BITORDER
 
 #define CONFIG_X86 1
 #define CONFIG_X86_HT 1
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 382ce91..fd5db05 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -18,8 +18,10 @@
 
 #ifndef CONFIG_COMPAT
 #define BITS_PER_EVTCHN_WORD(d) BITS_PER_XEN_ULONG
+#define EVTCHN_WORD_BITORDER(d) XEN_ULONG_BITORDER
 #else
 #define BITS_PER_EVTCHN_WORD(d) (has_32bit_shinfo(d) ? 32 : BITS_PER_XEN_ULONG)
+#define EVTCHN_WORD_BITORDER(d) (has_32bit_shinfo(d) ? 5 : XEN_ULONG_BITORDER)
 #endif
 static inline unsigned int max_evtchns(struct domain *d)
 {
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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