Patchwork [RFC,01/13] add smp_mb()

login
register
mail settings
Submitter Paolo Bonzini
Date Aug. 15, 2011, 9:08 p.m.
Message ID <1313442520-12062-2-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/110093/
State New
Headers show

Comments

Paolo Bonzini - Aug. 15, 2011, 9:08 p.m.
We'll need a full memory barrier, and __sync_synchronize() is
just too ugly to type.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qemu-barrier.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/qemu-barrier.h b/qemu-barrier.h
index b77fce2..7bd5268 100644
--- a/qemu-barrier.h
+++ b/qemu-barrier.h
@@ -4,6 +4,8 @@ 
 /* FIXME: arch dependant, x86 version */
 #define smp_wmb()   asm volatile("" ::: "memory")
 
+#define smp_mb()    __sync_synchronize()
+
 /* Compiler barrier */
 #define barrier()   asm volatile("" ::: "memory")