summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2014-07-22 10:59:08 -0400
committerKeith Packard <keithp@keithp.com>2014-07-28 12:18:55 -0700
commitb5141a1fab4d45c1af62db8dc712deb9776668a9 (patch)
treee2c418da868adb57e95a5920c56191cad64d812c
parent6d3ba80f197b04b6e0814190cf5c678c786c14d6 (diff)
xfree86: Simplify a bunch of OS and arch conditionals
All of this is inside #ifdef __GNUC__, between that and configure.ac we can assume there's a unixy thing under us. Given that there's no real reason to limit the arch paths to particular OSes, so let's not. The final #elif here, combined with the ones before it, effectively said "if not (alpha amd64 sparc* mips* ppc* arm* nds32 m68k sh hppa s390 m32r)", and as the comment above it hints, it's meant to cover i386 (and happens to also cover itanic). Flip the conditional around to be sensible. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--hw/xfree86/common/compiler.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index 54da1fd95..5fd0ea035 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -218,7 +218,7 @@ extern void write_mem_barrier(void);
#endif
#ifdef __GNUC__
-#if (defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) && (defined(__alpha__))
+#if defined(__alpha__)
#ifdef linux
/* for Linux on Alpha, we use the LIBC _inx/_outx routines */
@@ -291,7 +291,7 @@ extern _X_EXPORT unsigned int inl(unsigned int port);
#include <machine/pio.h>
#endif /* __NetBSD__ */
-#elif (defined(linux) || defined(__FreeBSD__)) && defined(__amd64__)
+#elif defined(__amd64__)
#include <inttypes.h>
@@ -340,7 +340,7 @@ inl(unsigned short port)
return ret;
}
-#elif (defined(linux) || defined(sun) || defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc__)
+#elif defined(__sparc__)
#ifndef ASI_PL
#define ASI_PL 0x88
@@ -652,7 +652,7 @@ xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
#endif /* !linux */
#endif /* __mips__ */
-#elif (defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)) && defined(__powerpc__)
+#elif defined(__powerpc__)
#ifndef MAP_FAILED
#define MAP_FAILED ((void *)-1)
@@ -1103,12 +1103,7 @@ inl(unsigned PORT_SIZE port)
#define mem_barrier() /* XXX: nop for now */
#define write_mem_barrier() /* XXX: nop for now */
-#else /* ix86 */
-
-#if !defined(__mc68000__) && !defined(__arm__) && \
- !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && \
- !defined(__m32r__) && !defined(__aarch64__) && !defined(__arc__) && \
- !defined(__xtensa__)
+#elif defined(__i386__) || defined(__ia64__)
static __inline__ void
outb(unsigned short port, unsigned char val)
@@ -1155,9 +1150,7 @@ inl(unsigned short port)
return ret;
}
-#endif
-
-#endif /* ix86 */
+#endif /* arch madness */
#else /* !GNUC */
#if defined(__STDC__) && (__STDC__ == 1)