[PATCH 4/9] Use sfence and mfence instructions on amd64

Matt Turner mattst88 at gmail.com
Wed Aug 12 22:45:37 PDT 2009


Signed-off-by: Matt Turner <mattst88 at gmail.com>
---
 hw/xfree86/common/compiler.h |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index ab0c79a..8ea19b3 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -150,10 +150,8 @@ extern unsigned short ldw_brx(volatile unsigned char *, int);
 
 #   elif defined __amd64__
 
-#    define mem_barrier() \
-       __asm__ __volatile__ ("lock; addl $0,0(%%rsp)" : : : "memory")
-#    define write_mem_barrier() \
-       __asm__ __volatile__ ("" : : : "memory")
+#    define mem_barrier() __asm__ __volatile__ ("mfence" : : : "memory")
+#    define write_mem_barrier() __asm__ __volatile__ ("sfence" : : : "memory")
 
 #   elif defined __ia64__
 
-- 
1.6.3.3



More information about the xorg-devel mailing list