Index: x11-servers/xorg-server/files/extra-new-arch-powerpc =================================================================== --- x11-servers/xorg-server/files/extra-new-arch-powerpc (revision 362293) +++ x11-servers/xorg-server/files/extra-new-arch-powerpc (working copy) @@ -1,35 +1,70 @@ ---- ./hw/xfree86/os-support/bsd/ppc_video.c.orig 2012-05-17 12:09:03.000000000 -0500 -+++ ./hw/xfree86/os-support/bsd/ppc_video.c 2014-01-18 14:36:42.000000000 -0600 -@@ -115,17 +115,19 @@ - Bool - xf86EnableIO() +--- hw/xfree86/os-support/bsd/ppc_video.c.orig 2014-07-22 07:52:58.000000000 -0700 ++++ hw/xfree86/os-support/bsd/ppc_video.c 2014-07-22 08:00:21.000000000 -0700 +@@ -44,6 +44,8 @@ + #define DEV_MEM "/dev/xf86" + #endif + ++static int kmem = -1; ++ + static pointer ppcMapVidMem(int, unsigned long, unsigned long, int flags); + static void ppcUnmapVidMem(int, pointer, unsigned long); + +@@ -68,6 +70,17 @@ + int fd = xf86Info.consoleFd; + pointer base; + ++#ifdef __FreeBSD__ ++ if (kmem == -1) { ++ kmem = open(DEV_MEM, 2); ++ if (kmem == -1) { ++ FatalError("mapVidMem: open %s", DEV_MEM); ++ } ++ } ++ ++ fd = kmem; ++#endif ++ + #ifdef DEBUG + xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", Base, Size, fd); + #endif +@@ -93,7 +106,6 @@ + int Len) { -- int fd = xf86Info.consoleFd; -+ int fd = open(DEV_MEM, O_RDWR); + int rv; +- static int kmem = -1; + if (kmem == -1) { + kmem = open(DEV_MEM, 2); +@@ -118,6 +130,8 @@ + int fd = xf86Info.consoleFd; + xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd); ++ ++#ifndef __FreeBSD__ if (ioBase == MAP_FAILED) { ioBase = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0xf2000000); - xf86MsgVerb(X_INFO, 3, "xf86EnableIO: %08x\n", ioBase); -+#if 0 /* Non-fatal */ - if (ioBase == MAP_FAILED) { - xf86MsgVerb(X_WARNING, 3, "Can't map IO space!\n"); +@@ -127,6 +141,12 @@ return FALSE; } + } +#endif - } ++ /* ++ * Note that outl() etc. check for ioBase == MAP_FAILED, so leaving it that ++ * way (e.g. on FreeBSD) is non-fatal. ++ */ ++ return TRUE; } -@@ -135,7 +137,11 @@ + +@@ -134,8 +154,10 @@ + xf86DisableIO() { ++#ifndef __FreeBSD__ if (ioBase != MAP_FAILED) { -+#if defined(__FreeBSD__) -+ munmap(__DEVOLATILE(unsigned char *, ioBase), 0x10000); -+#else munmap(__UNVOLATILE(ioBase), 0x10000); -+#endif ioBase = MAP_FAILED; } ++#endif }