diff options
author | Matt Turner <mattst88@gmail.com> | 2009-08-31 15:51:41 -0400 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2009-08-31 15:51:41 -0400 |
commit | 430c4af0d6e2cad03ca5f49ec6e87f3717d0d9e2 (patch) | |
tree | 6f55c2c734897e08814bfd2c6c3c1df16109a8fa /hw/xfree86 | |
parent | 0d87f77a3ff4b22729220b7edcb98c6f06d0787c (diff) |
Add x86 barrier macros
Signed-off-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'hw/xfree86')
-rw-r--r-- | hw/xfree86/common/compiler.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h index d1467eb7b..bb3e935a5 100644 --- a/hw/xfree86/common/compiler.h +++ b/hw/xfree86/common/compiler.h @@ -129,7 +129,21 @@ extern unsigned short ldw_brx(volatile unsigned char *, int); # ifndef NO_INLINE # ifdef __GNUC__ -# ifdef __alpha__ +# ifdef __i386__ + +# ifdef __SSE__ +# define write_mem_barrier() __asm__ __volatile__ ("sfence" : : : "memory") +# else +# define write_mem_barrier() __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory") +# endif + +# ifdef __SSE2__ +# define mem_barrier() __asm__ __volatile__ ("mfence" : : : "memory") +# else +# define mem_barrier() __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory") +# endif + +# elif defined __alpha__ # define mem_barrier() __asm__ __volatile__ ("mb" : : : "memory") # define write_mem_barrier() __asm__ __volatile__ ("wmb" : : : "memory") |