diff options
author | Jared D. McNeill <jmcneill@netbsd.org> | 2007-04-10 12:57:15 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2007-04-10 12:57:15 -0700 |
commit | 4aae2de74b9224bac2b2e2522637dac09abc3837 (patch) | |
tree | 108a18b87f9999cdaa39b5d6d4d380ba5a7bfb1f | |
parent | f77a8ea849d171a8ca00b2b7334866ace1ffbf73 (diff) |
Add a real xf86EnableIO/xf86DisableIO for NetBSD/PPC.
-rw-r--r-- | hw/xfree86/os-support/bsd/Makefile.am | 3 | ||||
-rw-r--r-- | hw/xfree86/os-support/bsd/ppc_video.c | 33 |
2 files changed, 34 insertions, 2 deletions
diff --git a/hw/xfree86/os-support/bsd/Makefile.am b/hw/xfree86/os-support/bsd/Makefile.am index 099240467..0432ba931 100644 --- a/hw/xfree86/os-support/bsd/Makefile.am +++ b/hw/xfree86/os-support/bsd/Makefile.am @@ -38,8 +38,7 @@ ARCH_SOURCES = i386_video.c endif if PPC_VIDEO -ARCH_SOURCES = ppc_video.c \ - $(srcdir)/../shared/ioperm_noop.c +ARCH_SOURCES = ppc_video.c endif if SPARC64_VIDEO diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c index ae65c8f15..6a23b4e5c 100644 --- a/hw/xfree86/os-support/bsd/ppc_video.c +++ b/hw/xfree86/os-support/bsd/ppc_video.c @@ -56,6 +56,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 +66,7 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) pVidMem->mapMem = ppcMapVidMem; pVidMem->unmapMem = ppcUnmapVidMem; pVidMem->initialised = TRUE; + xf86EnableIO(); } @@ -138,3 +142,32 @@ xf86EnableInterrupts() return; } + +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; + } +} + |