Commit 4302484e authored by Adam Jackson's avatar Adam Jackson 🎧 Committed by Keith Packard

dix: Remove arch awareness from servermd.h (v2)

At this point we have no architectures where image byte order is
different from bitmap bit order, or where either of those two are not
also the native word endianness.  Hooray, one more place where we don't
have to worry about enabling new CPU architectures.

v2: Rebase to master to handle the addition of ppc64le, arc, and xtensa,
and use autoconf's endianness detection instead of gcc predefines.
Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
parent 860cd209
......@@ -139,7 +139,8 @@ AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h \
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_TYPEOF
AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"])
AC_C_BIGENDIAN(AC_DEFINE(X_BYTE_ORDER, X_BIG_ENDIAN, [byte order]),
AC_DEFINE(X_BYTE_ORDER, X_LITTLE_ENDIAN, [byte order]))
AC_CHECK_SIZEOF([unsigned long])
if test "$ac_cv_sizeof_unsigned_long" = 8; then
......
......@@ -493,4 +493,7 @@
/* Build glamor's GBM-based EGL support */
#undef GLAMOR_HAS_GBM
/* byte order */
#undef X_BYTE_ORDER
#endif /* _DIX_CONFIG_H_ */
......@@ -47,195 +47,18 @@ SOFTWARE.
#ifndef SERVERMD_H
#define SERVERMD_H 1
/*
* Note: much of this is vestigial from mfb/cfb times. This should
* really be simplified even further.
*/
#ifdef __avr32__
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#endif /* __avr32__ */
#ifdef __arm32__
#include "dix-config.h"
#if X_BYTE_ORDER == X_LITTLE_ENDIAN
#define IMAGE_BYTE_ORDER LSBFirst
#define BITMAP_BIT_ORDER LSBFirst
#endif /* __arm32__ */
#if defined(__nds32__)
#define IMAGE_BYTE_ORDER LSBFirst
#endif /* __nds32__ */
#if defined __hppa__
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#endif /* hpux || __hppa__ */
#if defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__)
#if defined(__LITTLE_ENDIAN__)
#define IMAGE_BYTE_ORDER LSBFirst
#define BITMAP_BIT_ORDER LSBFirst
#else
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#endif
#endif /* PowerPC */
#if defined(__sh__)
#if defined(__BIG_ENDIAN__)
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#else
#define IMAGE_BYTE_ORDER LSBFirst
#define BITMAP_BIT_ORDER LSBFirst
#endif
#endif /* SuperH */
#if defined(__m32r__)
#if defined(__BIG_ENDIAN__)
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#else
#define IMAGE_BYTE_ORDER LSBFirst
#define BITMAP_BIT_ORDER LSBFirst
#endif
#endif /* __m32r__ */
#if defined(sun386) || defined(sun5)
#define IMAGE_BYTE_ORDER LSBFirst /* Values for the SUN only */
#define BITMAP_BIT_ORDER LSBFirst
#else
#define IMAGE_BYTE_ORDER MSBFirst /* Values for the SUN only */
#define BITMAP_BIT_ORDER MSBFirst
#endif
#if (defined(mips) || defined(__mips))
#if defined(MIPSEL) || defined(__MIPSEL__)
#define IMAGE_BYTE_ORDER LSBFirst /* Values for the PMAX only */
#define BITMAP_BIT_ORDER LSBFirst
#else
#define IMAGE_BYTE_ORDER MSBFirst /* Values for the MIPS only */
#define BITMAP_BIT_ORDER MSBFirst
#endif
#endif /* mips */
#if defined(__alpha) || defined(__alpha__)
#define IMAGE_BYTE_ORDER LSBFirst /* Values for the Alpha only */
#define BITMAP_BIT_ORDER LSBFirst
#endif /* alpha */
#if defined (linux) && defined (__s390__)
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#endif /* linux/s390 */
#if defined (linux) && defined (__s390x__)
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#endif /* linux/s390x */
#if defined(__ia64__) || defined(ia64)
#define IMAGE_BYTE_ORDER LSBFirst
#define BITMAP_BIT_ORDER LSBFirst
#endif /* ia64 */
#if defined(__amd64__) || defined(amd64) || defined(__amd64)
#define IMAGE_BYTE_ORDER LSBFirst
#define BITMAP_BIT_ORDER LSBFirst
#endif /* AMD64 */
#if defined(SVR4) && (defined(__i386__) || defined(__i386) ) || \
defined(__alpha__) || defined(__alpha) || \
defined(__i386__)
#ifndef IMAGE_BYTE_ORDER
#define IMAGE_BYTE_ORDER LSBFirst
#endif
#ifndef BITMAP_BIT_ORDER
#define BITMAP_BIT_ORDER LSBFirst
#endif
#endif /* SVR4 / BSD / i386 */
#if defined (linux) && defined (__mc68000__)
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#endif /* linux/m68k */
/* linux on ARM */
#if defined(linux) && defined(__arm__)
#define IMAGE_BYTE_ORDER LSBFirst
#define BITMAP_BIT_ORDER LSBFirst
#endif
/* linux on IBM S/390 */
#if defined (linux) && defined (__s390__)
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#endif /* linux/s390 */
#ifdef __aarch64__
#ifdef __AARCH64EL__
#define IMAGE_BYTE_ORDER LSBFirst
#define BITMAP_BIT_ORDER LSBFirst
#endif
#ifdef __AARCH64EB__
#elif X_BYTE_ORDER == X_BIG_ENDIAN
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#endif
#endif /* __aarch64__ */
#if defined(__arc__)
#if defined(__BIG_ENDIAN__)
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#else
#define IMAGE_BYTE_ORDER LSBFirst
#define BITMAP_BIT_ORDER LSBFirst
#error "Too weird to live."
#endif
#endif /* ARC */
#ifdef __xtensa__
#ifdef __XTENSA_EL__
#define IMAGE_BYTE_ORDER LSBFirst
#define BITMAP_BIT_ORDER LSBFirst
#endif
#ifdef __XTENSA_EB__
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#endif
#endif /* __xtensa__ */
#ifndef GLYPHPADBYTES
#define GLYPHPADBYTES 4
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment