summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'x11-base/xorg-server/files/0002-compiler.h-change-MIPS-IOPortBase-to-ioBase.patch')
-rw-r--r--x11-base/xorg-server/files/0002-compiler.h-change-MIPS-IOPortBase-to-ioBase.patch104
1 files changed, 104 insertions, 0 deletions
diff --git a/x11-base/xorg-server/files/0002-compiler.h-change-MIPS-IOPortBase-to-ioBase.patch b/x11-base/xorg-server/files/0002-compiler.h-change-MIPS-IOPortBase-to-ioBase.patch
new file mode 100644
index 0000000..a6bee61
--- /dev/null
+++ b/x11-base/xorg-server/files/0002-compiler.h-change-MIPS-IOPortBase-to-ioBase.patch
@@ -0,0 +1,104 @@
+From d83874593b04258cc5b866eb57d4d085eed67fae Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Thu, 10 May 2012 13:21:20 -0400
+Subject: [PATCH 2/3] compiler.h: change MIPS IOPortBase to ioBase
+
+This will allow us to use the existing __powerpc__ code paths in
+lnx_video.c.
+
+Also remove unnecessary casts.
+
+Signed-off-by: Matt Turner <mattst88@gmail.com>
+---
+ hw/xfree86/common/compiler.h | 33 ++++++++++++------------------
+ hw/xfree86/os-support/linux/lnx_video.c | 5 +++-
+ 2 files changed, 17 insertions(+), 21 deletions(-)
+
+diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
+index 27bce92..9669df9 100644
+--- a/hw/xfree86/common/compiler.h
++++ b/hw/xfree86/common/compiler.h
+@@ -704,50 +704,43 @@ xf86WriteMmio32LeNB(__volatile__ void *base, const unsigned long offset,
+ }
+
+ #elif defined(__mips__)
+-#define PORT_SIZE short
+
+-_X_EXPORT unsigned int IOPortBase; /* Memory mapped I/O port area */
++extern _X_EXPORT volatile unsigned char *ioBase;
+
+ static __inline__ void
+-outb(unsigned PORT_SIZE port, unsigned char val)
++outb(unsigned short port, unsigned char val)
+ {
+- *(volatile unsigned char *) (((unsigned PORT_SIZE) (port)) + IOPortBase) =
+- val;
++ *(volatile unsigned char *) (port + (uintptr_t)ioBase) = val;
+ }
+
+ static __inline__ void
+-outw(unsigned PORT_SIZE port, unsigned short val)
++outw(unsigned short port, unsigned short val)
+ {
+- *(volatile unsigned short *) (((unsigned PORT_SIZE) (port)) + IOPortBase) =
+- val;
++ *(volatile unsigned short *) (port + (uintptr_t)ioBase) = val;
+ }
+
+ static __inline__ void
+-outl(unsigned PORT_SIZE port, unsigned int val)
++outl(unsigned short port, unsigned int val)
+ {
+- *(volatile unsigned int *) (((unsigned PORT_SIZE) (port)) + IOPortBase) =
+- val;
++ *(volatile unsigned int *) (port + (uintptr_t)ioBase) = val;
+ }
+
+ static __inline__ unsigned int
+-inb(unsigned PORT_SIZE port)
++inb(unsigned short port)
+ {
+- return *(volatile unsigned char *) (((unsigned PORT_SIZE) (port)) +
+- IOPortBase);
++ return *(volatile unsigned char *) (port + (uintptr_t)ioBase);
+ }
+
+ static __inline__ unsigned int
+-inw(unsigned PORT_SIZE port)
++inw(unsigned short port)
+ {
+- return *(volatile unsigned short *) (((unsigned PORT_SIZE) (port)) +
+- IOPortBase);
++ return *(volatile unsigned short *) (port + (uintptr_t)ioBase);
+ }
+
+ static __inline__ unsigned int
+-inl(unsigned PORT_SIZE port)
++inl(unsigned short port)
+ {
+- return *(volatile unsigned int *) (((unsigned PORT_SIZE) (port)) +
+- IOPortBase);
++ return *(volatile unsigned int *) (port + (uintptr_t)ioBase);
+ }
+
+ #ifdef linux /* don't mess with other OSs */
+diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
+index 3526a21..cd46f97 100644
+--- a/hw/xfree86/os-support/linux/lnx_video.c
++++ b/hw/xfree86/os-support/linux/lnx_video.c
+@@ -472,8 +472,11 @@ unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+ /* I/O Permissions section */
+ /***************************************************************************/
+
+-#if defined(__powerpc__)
++#if defined(__powerpc__) || defined(__mips__)
+ volatile unsigned char *ioBase = NULL;
++#endif
++
++#if defined(__powerpc__)
+
+ #ifndef __NR_pciconfig_iobase
+ #define __NR_pciconfig_iobase 200
+--
+1.7.3.4
+