Hi,

Since my zaurus was stolen last year, I need someone to test the diff
below on a zaurus...

it simplifies the code a bit (more to come for xserver 1.17 later) and
makes it possible to run the wsudl on armv7 with a few more tweaks.

Thanks in advance.

Index: hw/xfree86/os-support/bsd/arm_video.c
===================================================================
RCS file: /cvs/xenocara/xserver/hw/xfree86/os-support/bsd/arm_video.c,v
retrieving revision 1.11
diff -u -p -u -r1.11 arm_video.c
--- hw/xfree86/os-support/bsd/arm_video.c       27 Sep 2014 17:53:02 -0000      
1.11
+++ hw/xfree86/os-support/bsd/arm_video.c       23 May 2015 21:23:41 -0000
@@ -69,33 +69,23 @@
 #include "xf86_OSlib.h"
 #include "xf86OSpriv.h"
 
-#include "bus/Pci.h"
-
 #ifndef MAP_FAILED
 #define MAP_FAILED ((caddr_t)-1)
 #endif
 
-#include <sys/param.h>
-#include <sys/sysctl.h>
-
 /***************************************************************************/
 /* Video Memory Mapping section                                            */
 /***************************************************************************/
 
-#ifdef __OpenBSD__
-#undef DEV_MEM
-#define DEV_MEM "/dev/xf86"
-#endif
-
-static void* ppcMapVidMem(int, unsigned long, unsigned long, int flags);
-static void ppcUnmapVidMem(int, void *, unsigned long);
+static void* armMapVidMem(int, unsigned long, unsigned long, int flags);
+static void armUnmapVidMem(int, void *, unsigned long);
 
 void
 xf86OSInitVidMem(VidMemInfoPtr pVidMem)
 {
     pVidMem->linearSupported = TRUE;
-    pVidMem->mapMem = ppcMapVidMem;
-    pVidMem->unmapMem = ppcUnmapVidMem;
+    pVidMem->mapMem = armMapVidMem;
+    pVidMem->unmapMem = armUnmapVidMem;
     pVidMem->initialised = TRUE;
 }
 
@@ -103,7 +93,7 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
 volatile unsigned char *ioBase = MAP_FAILED;
 
 static void*
-ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
+armMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
 {
     int fd = xf86Info.consoleFd;
     void *base;
@@ -124,40 +114,17 @@ ppcMapVidMem(int ScreenNum, unsigned lon
 }
 
 static void
-ppcUnmapVidMem(int ScreenNum, void *Base, unsigned long Size)
+armUnmapVidMem(int ScreenNum, void *Base, unsigned long Size)
 {
 
     munmap(Base, Size);
 }
 
-static int kmem = -1;
-
 int
 xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
              int Len)
 {
-    int rv;
-    
-    if (Base < 0x80000000) {
-        xf86Msg(X_WARNING, "No VGA Base=%#lx\n", Base);
-        return 0;
-    }
-    
-    if (kmem == -1) {
-        kmem = open(DEV_MEM, 2);
-        if (kmem == -1) {
-            FatalError("xf86ReadBIOS: open %s", DEV_MEM);
-        }
-    }
-    
-#ifdef DEBUG
-    xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS() %lx %lx, %x\n",
-                Base, Offset, Len);
-#endif
-    
-    lseek(kmem, Base + Offset, 0);
-    rv = read(kmem, Buf, Len);
-    return rv;
+    return -1;
 }
 
 /*
@@ -166,26 +133,6 @@ xf86ReadBIOS(unsigned long Base, unsigne
 void
 xf86PrivilegedInit(void)
 {
-    int mib[2];
-    char buf[128];
-    size_t len;
-    
-    mib[0] = CTL_HW;
-    mib[1] = HW_MACHINE;
-    len = sizeof(buf);
-    if (sysctl(mib, 2, buf, &len, NULL, 0) < 0) {
-        FatalError("Cannot get hw.machine");
-    }
-    if (strcmp(buf, "zaurus") != 0 &&
-        strcmp(buf, "armish") != 0) {
-        /* Not Zaurus */
-        kmem = open(DEV_MEM, 2);
-        if (kmem == -1) {
-            ErrorF("errno: %d\n", errno);
-            FatalError("xf86PrivilegedInit: open %s", DEV_MEM);
-        }
-        pci_system_init();
-    }
     xf86OpenConsole();
 }
 

-- 
Matthieu Herrb

Reply via email to