diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-25 19:28:16 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-25 19:28:16 +0000 |
commit | 55019a1748a69f278dcc728e0db7ee79d426e695 (patch) | |
tree | f7624cbda00d033bbceeece2b3843fb201f623f4 /src/XF86DGA2.c | |
parent | 2b92812979340a133c14336d4a87ea95a942b676 (diff) |
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_903_specialxf86-4_3_99_902xf86-4_3_99_901xf86-4_3_99_16xf86-012804-2330
Diffstat (limited to 'src/XF86DGA2.c')
-rw-r--r-- | src/XF86DGA2.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/XF86DGA2.c b/src/XF86DGA2.c index c3bd960..4dd7de8 100644 --- a/src/XF86DGA2.c +++ b/src/XF86DGA2.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/Xxf86dga/XF86DGA2.c,v 1.21 2002/12/14 04:41:12 dawes Exp $ */ +/* $XFree86: xc/lib/Xxf86dga/XF86DGA2.c,v 1.24 2003/11/21 05:07:16 dawes Exp $ */ /* Copyright (c) 1995 Jon Tombs @@ -11,6 +11,7 @@ Copyright (c) 1995,1996 The XFree86 Project, Inc #ifdef __UNIXOS2__ /* needed here to override certain constants in X headers */ #define INCL_DOS #define INCL_DOSIOCTL +#define I_NEED_OS2_H #include <os2.h> #endif @@ -67,6 +68,7 @@ static XExtensionHooks xdga_extension_hooks = { static XEXT_GENERATE_CLOSE_DISPLAY (xdga_close_display, xdga_info) +XExtDisplayInfo* xdga_find_display(Display*); XEXT_GENERATE_FIND_DISPLAY (xdga_find_display, xdga_info, "XFree86-DGA", &xdga_extension_hooks, @@ -744,6 +746,8 @@ void XDGAKeyEventToXKeyEvent( #define DEV_MEM "/dev/pmem" #elif defined(SVR4) && defined(sun) #define DEV_MEM "/dev/xsvc" +#elif defined(HAS_APERTURE_DRV) +#define DEV_MEM "/dev/xf86" #else #define DEV_MEM "/dev/mem" #endif @@ -931,11 +935,6 @@ DGAMapPhysical( MAP_FILE | MAP_SHARED, pMap->fd, (off_t)base); if (pMap->virtual == (void *)-1) return False; -#endif - -#if !defined(ISC) && !defined(HAS_SVR3_MMAP) \ - && !(defined(Lynx) && defined(NO_MMAP)) \ - && !defined(__UNIXOS2__) mprotect(pMap->virtual, size, PROT_READ | PROT_WRITE); #endif @@ -947,16 +946,23 @@ DGAMapPhysical( static void DGAUnmapPhysical(DGAMapPtr pMap) { -#if !defined(ISC) && !defined(HAS_SVR3_MMAP) \ - && !(defined(Lynx) && defined(NO_MMAP)) \ - && !defined(__UNIXOS2__) - mprotect(pMap->virtual,pMap->size, PROT_READ); +#if defined(ISC) && defined(HAS_SVR3_MMAP) + /* XXX Add unmapping code here. */ +#elif defined (__UNIXOS2__) + /* XXX Add unmapping code here. */ #elif defined(Lynx) && defined(NO_MMAP) /* XXX this doesn't allow enable after disable */ smem_create(NULL, pMap->virtual, pMap->size, SM_DETACH); smem_remove("XF86DGA"); +#else + if (pMap->virtual && pMap->virtual != (void *)-1) { + mprotect(pMap->virtual,pMap->size, PROT_READ); + munmap(pMap->virtual, pMap->size); + pMap->virtual = 0; + } + if (pMap->fd >= 0) { + close(pMap->fd); + pMap->fd = -1; + } #endif - - - /* We need to unmap and close too !!!!!!!!!!*/ } |