[Xquartz-changes] xserver: Branch 'bus-cleanup' - 2 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Sat Oct 15 21:46:30 PDT 2011


 hw/xfree86/common/compiler.h            |    2 +-
 hw/xfree86/os-support/bsd/arm_video.c   |   11 +++++------
 hw/xfree86/os-support/linux/lnx_video.c |   11 ++++++++---
 3 files changed, 14 insertions(+), 10 deletions(-)

New commits:
commit b8eb51e25e2b3d6ac13d4d1621d907d68ee364f9
Author: Matt Kraai <kraai at ftbfs.org>
Date:   Sat Oct 15 21:35:35 2011 -0700

    xfree86: Add Loongson MIPS support
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=41038
    
    Signed-off-by: Matt Kraai <kraai at ftbfs.org>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index 18116bd..a023da3 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -131,16 +131,21 @@ volatile unsigned char *ioBase = NULL;
 Bool
 xf86EnableIO(void)
 {
-#if defined(__powerpc__)
+#if defined(__mips__) || defined(__powerpc__)
 	int fd;
-	unsigned int ioBase_phys;
+	pointer ioBase_phys;
 #endif
 
 	if (ExtendedEnabled)
 		return TRUE;
 
-#if defined(__powerpc__)
+#if defined(__mips__) || defined(__powerpc__)
+
+# if defined(__mips__)
+	ioBase_phys = 0x1fd00000;
+# elif defined(__powerpc__)
 	ioBase_phys = syscall(__NR_pciconfig_iobase, 2, 0, 0);
+# endif
 
 	fd = open("/dev/mem", O_RDWR);
 	if (ioBase == NULL) {
commit fc07148bbfd6be85118b0a0216d7841f1d8b0bb3
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat Oct 15 21:34:42 2011 -0700

    xfree86: Fix type of IOPortBase to be a pointer
    
    This addresses issues on 64bit systems where the IOPortBase is higher in
    memory space.
    
    Partially fixes: https://bugs.freedesktop.org/show_bug.cgi?id=41038
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index 9e00d75..e4856a2 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -714,7 +714,7 @@ xf86WriteMmio32LeNB(__volatile__ void *base, const unsigned long offset,
 #     define PORT_SIZE short
 #    endif
 
-_X_EXPORT unsigned int IOPortBase;  /* Memory mapped I/O port area */
+_X_EXPORT pointer IOPortBase;  /* Memory mapped I/O port area */
 
 static __inline__ void
 outb(unsigned PORT_SIZE port, unsigned char val)
diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c
index b59c8e0..dac6587 100644
--- a/hw/xfree86/os-support/bsd/arm_video.c
+++ b/hw/xfree86/os-support/bsd/arm_video.c
@@ -475,7 +475,7 @@ int ScreenNum;
 #endif
 
 #ifdef __arm32__
-	IOPortBase = (unsigned int)-1;
+	IOPortBase = (pointer)-1;
 
 	if((memInfoP = checkMapInfo(TRUE, MMIO_REGION)) != NULL)
 	{
@@ -487,8 +487,7 @@ int ScreenNum;
 	     * actually mmap the start of the page, then the start of video
 	     * I/O space is added as an internal offset.
 	     */
-	    IOPortBase = (unsigned int)xf86MapInfoMap(memInfoP,
-						      (caddr_t)0x0, 0L) 
+	    IOPortBase = (pointer)xf86MapInfoMap(memInfoP, (caddr_t)0x0, 0L)
 		- memInfoP->memInfo.u.map_info_mmap.internal_offset;
 	    ExtendedEnabled = TRUE;
 	    return TRUE;
@@ -502,10 +501,10 @@ int ScreenNum;
 				 MAP_FLAGS, devMemFd, (off_t)DEV_MEM_IOBASE);
 
 	    if (base != (pointer)-1)
-		IOPortBase = (unsigned int)base;
+		IOPortBase = base;
 	}
 
-        if (IOPortBase == (unsigned int)-1)
+        if (IOPortBase == (pointer)-1)
 	{	
 	    xf86Msg(X_WARNING,"xf86EnableIOPorts: failed to open mem device or map IO base. \n\
 Make sure you have the Aperture Driver installed, or a kernel built with the INSECURE option\n");
@@ -551,7 +550,7 @@ int ScreenNum;
 			return;
 
 	munmap((caddr_t)IOPortBase, 0x400);
-	IOPortBase = (unsigned int)-1;
+	IOPortBase = (pointer)-1;
 	ExtendedEnabled = FALSE;
 #endif
 


More information about the Xquartz-changes mailing list