diff options
Diffstat (limited to 'xserver/hw/xfree86/os-support/bsd/ppc_video.c')
-rw-r--r-- | xserver/hw/xfree86/os-support/bsd/ppc_video.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/xserver/hw/xfree86/os-support/bsd/ppc_video.c b/xserver/hw/xfree86/os-support/bsd/ppc_video.c index 04a8dc224..4a84f9673 100644 --- a/xserver/hw/xfree86/os-support/bsd/ppc_video.c +++ b/xserver/hw/xfree86/os-support/bsd/ppc_video.c @@ -23,8 +23,6 @@ * */ -/* $XConsortium: bsd_video.c /main/10 1996/10/25 11:37:57 kaleb $ */ - #ifdef HAVE_XORG_CONFIG_H #include <xorg-config.h> #endif @@ -56,6 +54,9 @@ static pointer ppcMapVidMem(int, unsigned long, unsigned long, int flags); static void ppcUnmapVidMem(int, pointer, unsigned long); +Bool xf86EnableIO(void); +void xf86DisableIO(void); + void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { @@ -63,6 +64,7 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) pVidMem->mapMem = ppcMapVidMem; pVidMem->unmapMem = ppcUnmapVidMem; pVidMem->initialised = TRUE; + xf86EnableIO(); } @@ -162,3 +164,32 @@ xf86PrivilegedInit(void) xf86OpenConsole(); } #endif + +Bool xf86EnableIO() +{ + int fd = xf86Info.screenFd; + + xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd); + 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 (ioBase == MAP_FAILED) { + xf86MsgVerb(X_WARNING, 3, "Can't map IO space!\n"); + return FALSE; + } + } + return TRUE; +} + +void xf86DisableIO() +{ + + if (ioBase != MAP_FAILED) + { + munmap(__UNVOLATILE(ioBase), 0x10000); + ioBase = MAP_FAILED; + } +} + |