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

Hans de Goede hdegoede at redhat.com
Wed Feb 2 05:16:55 PST 2011


Ack.

On 02/02/2011 10:36 AM, Arnon Gilboa wrote:
> __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 */


More information about the Spice-devel mailing list