summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2009-08-31 15:51:05 -0400
committerMatt Turner <mattst88@gmail.com>2009-08-31 15:51:05 -0400
commit0d87f77a3ff4b22729220b7edcb98c6f06d0787c (patch)
tree5e2bb6bb144cf8745032ed305ebab3d15af3ce6c
parent1b43ee13b30d9e3f828e94cdf686d103ce1cac07 (diff)
define barrier macros as nops if not otherwise defined
Signed-off-by: Matt Turner <mattst88@gmail.com>
-rw-r--r--hw/xfree86/common/compiler.h38
1 files changed, 10 insertions, 28 deletions
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index 5395c4733..d1467eb7b 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -141,16 +141,6 @@ extern unsigned short ldw_brx(volatile unsigned char *, int);
# define write_mem_barrier() \
__asm__ __volatile__ ("" : : : "memory")
-# elif defined __arm__
-
-# define mem_barrier() /* NOP */
-# define write_mem_barrier() /* NOP */
-
-# elif defined __arm32__
-
-# define mem_barrier() /* NOP */
-# define write_mem_barrier() /* NOP */
-
# elif defined __ia64__
# ifndef __INTEL_COMPILER
@@ -163,8 +153,7 @@ extern unsigned short ldw_brx(volatile unsigned char *, int);
# endif
# elif defined __mips__
-# ifdef linux
-# define mem_barrier() \
+# define mem_barrier() \
__asm__ __volatile__( \
"# prevent instructions being moved around\n\t" \
".set\tnoreorder\n\t" \
@@ -174,11 +163,7 @@ extern unsigned short ldw_brx(volatile unsigned char *, int);
: /* no output */ \
: /* no input */ \
: "memory")
-# define write_mem_barrier() mem_barrier()
-
-# else /* !linux */
-# define mem_barrier() /* NOP */
-# endif
+# define write_mem_barrier() mem_barrier()
# elif defined __powerpc__
@@ -200,21 +185,18 @@ extern unsigned short ldw_brx(volatile unsigned char *, int);
# define barrier() __asm__ __volatile__ (".word 0x8143e00a" : : : "memory")
# define mem_barrier() /* XXX: nop for now */
# define write_mem_barrier() /* XXX: nop for now */
-
-# else /* ix86 */
-
-# define mem_barrier() /* NOP */
-# define write_mem_barrier() /* NOP */
-
# endif
-# else
-
-# define mem_barrier() /* NOP */
-# define write_mem_barrier() /* NOP */
-
# endif /* __GNUC__ */
# endif /* NO_INLINE */
+# ifndef mem_barrier
+# define mem_barrier() /* NOP */
+# endif
+
+# ifndef write_mem_barrier
+# define write_mem_barrier() /* NOP */
+# endif
+
# ifndef NO_INLINE
# ifdef __GNUC__
# if (defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) && (defined(__alpha__))