summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-02-01 21:12:43 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-02-01 21:12:43 +0000
commite603d8e876f833e8d5428577f0bbc265589e6e72 (patch)
tree78ee9d1d4b9161b59f4cd3952a564f44fea2010e
parent315e73dfc880f650f1a1905ec5068e6e31c193ee (diff)
basic support for mips64el. ok miod@.
-rw-r--r--xserver/hw/xfree86/common/compiler.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/xserver/hw/xfree86/common/compiler.h b/xserver/hw/xfree86/common/compiler.h
index 0486d6d9c..3088cb8cc 100644
--- a/xserver/hw/xfree86/common/compiler.h
+++ b/xserver/hw/xfree86/common/compiler.h
@@ -869,7 +869,7 @@ static __inline__ void stw_u(unsigned long val, unsigned short *p)
# define write_mem_barrier() /* XXX: nop for now */
# elif defined(__mips__) || (defined(__arm32__) && !defined(__linux__))
-# ifdef __arm32__
+# if defined(__arm32__) || defined(__mips64__)
# define PORT_SIZE long
# else
# define PORT_SIZE short
@@ -1021,14 +1021,18 @@ xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
# else /* !linux */
# define stq_u(v,p) stl_u(v,p)
-# define stl_u(v,p) (*(unsigned char *)(p)) = (v); \
+# if X_BYTE_ORDER == X_BIG_ENDIAN
+# define stl_u(v,p) (*(unsigned char *)(p)) = (v); \
(*(unsigned char *)(p)+1) = ((v) >> 8); \
(*(unsigned char *)(p)+2) = ((v) >> 16); \
(*(unsigned char *)(p)+3) = ((v) >> 24)
-# define stw_u(v,p) (*(unsigned char *)(p)) = (v); \
+# define stw_u(v,p) (*(unsigned char *)(p)) = (v); \
(*(unsigned char *)(p)+1) = ((v) >> 8)
-
+# else
+# define stl_u(v,p) (*(unsigned int *)(p)) = (v)
+# define stw_u(v,p) (*(unsigned short *)(p)) = (v)
+# endif
# define mem_barrier() /* NOP */
# endif /* !linux */
# endif /* __mips__ */