mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-protocol
synced 2025-12-29 08:47:11 +00:00
Use <spice/barrier.h> memory barrier
This commit is contained in:
parent
590e21bc57
commit
9032d5235b
@ -107,13 +107,13 @@ typedef struct SPICE_ATTR_PACKED name { \
|
||||
#define RING_PROD_WAIT(r, wait) \
|
||||
if (((wait) = RING_IS_FULL(r))) { \
|
||||
(r)->notify_on_cons = (r)->cons + 1; \
|
||||
mb(); \
|
||||
spice_mb(); \
|
||||
(wait) = RING_IS_FULL(r); \
|
||||
}
|
||||
|
||||
#define RING_PUSH(r, notify) \
|
||||
(r)->prod++; \
|
||||
mb(); \
|
||||
spice_mb(); \
|
||||
(notify) = (r)->prod == (r)->notify_on_prod;
|
||||
|
||||
|
||||
@ -122,13 +122,13 @@ typedef struct SPICE_ATTR_PACKED name { \
|
||||
#define RING_CONS_WAIT(r, wait) \
|
||||
if (((wait) = RING_IS_EMPTY(r))) { \
|
||||
(r)->notify_on_prod = (r)->prod + 1; \
|
||||
mb(); \
|
||||
spice_mb(); \
|
||||
(wait) = RING_IS_EMPTY(r); \
|
||||
}
|
||||
|
||||
#define RING_POP(r, notify) \
|
||||
(r)->cons++; \
|
||||
mb(); \
|
||||
spice_mb(); \
|
||||
(notify) = (r)->cons == (r)->notify_on_cons;
|
||||
|
||||
|
||||
|
||||
@ -33,21 +33,11 @@
|
||||
#define _H_QXL_DEV
|
||||
|
||||
#include <spice/types.h>
|
||||
#include <spice/barrier.h>
|
||||
|
||||
#include "ipc_ring.h"
|
||||
#include "draw.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#ifdef __i386__
|
||||
#define mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
|
||||
#else
|
||||
//mfence
|
||||
#define mb() __asm__ __volatile__ ("lock; addl $0,0(%%rsp)": : :"memory")
|
||||
#endif
|
||||
#else
|
||||
#define mb() __asm {lock add [esp], 0}
|
||||
#endif
|
||||
|
||||
#include <spice/start-packed.h>
|
||||
|
||||
#define REDHAT_PCI_VENDOR_ID 0x1b36
|
||||
|
||||
@ -32,20 +32,10 @@
|
||||
#define _H_VDI_DEV
|
||||
|
||||
#include <spice/types.h>
|
||||
#include <spice/barrier.h>
|
||||
|
||||
#include "ipc_ring.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#ifdef __i386__
|
||||
#define mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
|
||||
#else
|
||||
//mfence
|
||||
#define mb() __asm__ __volatile__ ("lock; addl $0,0(%%rsp)": : :"memory")
|
||||
#endif
|
||||
#else
|
||||
#define mb() __asm {lock add [esp], 0}
|
||||
#endif
|
||||
|
||||
#include <spice/start-packed.h>
|
||||
|
||||
#define REDHAT_PCI_VENDOR_ID 0x1b36
|
||||
|
||||
Loading…
Reference in New Issue
Block a user