[Spice-devel] [PATCH spice-protocol] define spice_mb MemoryBarrier for WIN64

Arnon Gilboa agilboa at redhat.com
Wed Feb 2 01:36:08 PST 2011


__asm is not supported on _WIN64, so use macro instead
required for Windows x64 guest display driver (qxldd.dll)
---
 spice/barrier.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/spice/barrier.h b/spice/barrier.h
index 8c81c86..710da09 100644
--- a/spice/barrier.h
+++ b/spice/barrier.h
@@ -33,14 +33,23 @@
 #define _H_SPICE_BARRIER
 
 #ifdef __GNUC__
+
 #ifdef __i386__
 #define spice_mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
 #else
 //mfence
 #define spice_mb() __asm__ __volatile__ ("lock; addl $0,0(%%rsp)": : :"memory")
 #endif
+
+#else
+
+#ifdef _WIN64
+//__asm not supported on _WIN64, so use macro instead.
+#define spice_mb MemoryBarrier
 #else
 #define spice_mb() __asm {lock add [esp], 0}
 #endif
 
+#endif
+
 #endif /* _H_SPICE_BARRIER */
-- 
1.7.3.4



More information about the Spice-devel mailing list