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

[Xen-devel] [RFC PATCH V5 12/15] evtchn: 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/sched.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/sched.h b/xen/include/xen/sched.h
index 71eebb6..a4d9df7 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -47,8 +47,10 @@ extern struct domain *dom0;
 
 #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
 /*
  * To make sure EVTCHNS_PER_BUCKET is at least 1 for 32 bit build,
-- 
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®.