diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/XF86DGA.c | 44 | ||||
-rw-r--r-- | src/XF86DGA2.c | 38 |
2 files changed, 6 insertions, 76 deletions
diff --git a/src/XF86DGA.c b/src/XF86DGA.c index d5df369..c582939 100644 --- a/src/XF86DGA.c +++ b/src/XF86DGA.c @@ -329,20 +329,6 @@ Bool XF86DGAViewPortChanged( #include <stdlib.h> #include <stdio.h> #include <fcntl.h> -#if defined(ISC) -# define HAS_SVR3_MMAP -# include <sys/types.h> -# include <errno.h> - -# include <sys/at_ansi.h> -# include <sys/kd.h> - -# include <sys/sysmacros.h> -# include <sys/immu.h> -# include <sys/region.h> - -# include <sys/mmap.h> -#else # if defined(Lynx) && defined(NO_MMAP) # include <sys/types.h> # include <errno.h> @@ -350,7 +336,6 @@ Bool XF86DGAViewPortChanged( # else # include <sys/mman.h> # endif -#endif #include <sys/wait.h> #include <signal.h> #include <unistd.h> @@ -452,9 +437,6 @@ MapPhysAddress(unsigned long address, unsigned long size) int pagesize = -1; void *vaddr; MapPtr mp; -#if defined(ISC) && defined(HAS_SVR3_MMAP) - struct kd_memloc mloc; -#endif if ((mp = FindMap(address, size))) { mp->refcount++; @@ -481,22 +463,9 @@ MapPhysAddress(unsigned long address, unsigned long size) delta = address % pagesize; offset = address - delta; - -#if defined(ISC) && defined(HAS_SVR3_MMAP) - if (mapFd < 0) { - if ((mapFd = open("/dev/mmap", O_RDWR)) < 0) - return NULL; - } - mloc.vaddr = (char *)0; - mloc.physaddr = (char *)offset; - mloc.length = size + delta; - mloc.ioflg=1; - - if ((vaddr = (void *)ioctl(mapFd, MAP, &mloc)) == (void *)-1) - return NULL; -#elif defined(Lynx) && defined(NO_MMAP) +#if defined(Lynx) && defined(NO_MMAP) vaddr = (void *)smem_create("XF86DGA", (char *)offset, - size + delta, SM_READ|SM_WRITE); + size + delta, SM_READ|SM_WRITE); #else #ifndef MAP_FILE #define MAP_FILE 0 @@ -506,7 +475,7 @@ MapPhysAddress(unsigned long address, unsigned long size) return NULL; } vaddr = (void *)mmap(NULL, size + delta, PROT_READ | PROT_WRITE, - MAP_FILE | MAP_SHARED, mapFd, (off_t)offset); + MAP_FILE | MAP_SHARED, mapFd, (off_t)offset); if (vaddr == (void *)-1) return NULL; #endif @@ -569,14 +538,12 @@ XF86DGADirectVideo( mp = sp->map; if (enable & XF86DGADirectGraphics) { -#if !defined(ISC) && !defined(HAS_SVR3_MMAP) \ - && !(defined(Lynx) && defined(NO_MMAP)) +#if !(defined(Lynx) && defined(NO_MMAP)) if (mp && mp->vaddr) mprotect(mp->vaddr, mp->size + mp->delta, PROT_READ | PROT_WRITE); #endif } else { -#if !defined(ISC) && !defined(HAS_SVR3_MMAP) \ - && !(defined(Lynx) && defined(NO_MMAP)) +#if !(defined(Lynx) && defined(NO_MMAP)) if (mp && mp->vaddr) mprotect(mp->vaddr, mp->size + mp->delta, PROT_READ); #elif defined(Lynx) && defined(NO_MMAP) @@ -660,4 +627,3 @@ XF86DGAGetVideo( return 1; } - diff --git a/src/XF86DGA2.c b/src/XF86DGA2.c index 9f13faf..6479c18 100644 --- a/src/XF86DGA2.c +++ b/src/XF86DGA2.c @@ -737,20 +737,6 @@ void XDGAKeyEventToXKeyEvent( #include <stdlib.h> #include <stdio.h> #include <fcntl.h> -#if defined(ISC) -# define HAS_SVR3_MMAP -# include <sys/types.h> -# include <errno.h> - -# include <sys/at_ansi.h> -# include <sys/kd.h> - -# include <sys/sysmacros.h> -# include <sys/immu.h> -# include <sys/region.h> - -# include <sys/mmap.h> -#else # if defined(Lynx) && defined(NO_MMAP) # include <sys/types.h> # include <errno.h> @@ -758,7 +744,6 @@ void XDGAKeyEventToXKeyEvent( # else # include <sys/mman.h> # endif -#endif #include <sys/wait.h> #include <signal.h> #include <unistd.h> @@ -884,9 +869,6 @@ DGAMapPhysical( CARD32 extra, /* optional extra data */ DGAMapPtr pMap ) { -#if defined(ISC) && defined(HAS_SVR3_MMAP) - struct kd_memloc mloc; -#endif base += offset; @@ -894,17 +876,7 @@ DGAMapPhysical( pMap->physical = base; pMap->size = size; -#if defined(ISC) && defined(HAS_SVR3_MMAP) - if ((pMap->fd = open("/dev/mmap", O_RDWR)) < 0) - return False; - mloc.vaddr = (char *)0; - mloc.physaddr = (char *)base; - mloc.length = size; - mloc.ioflg=1; - - if ((pMap->virtual = (void *)ioctl(pMap->fd, MAP, &mloc)) == (void *)-1) - return False; -#elif defined (Lynx) && defined(NO_MMAP) +#if defined (Lynx) && defined(NO_MMAP) pMap->virtual = smem_create("XF86DGA", (char*)base, size, SM_READ|SM_WRITE); #else #ifndef MAP_FILE @@ -929,13 +901,6 @@ DGAMapPhysical( static void DGAUnmapPhysical(DGAMapPtr pMap) { -#if defined(ISC) && defined(HAS_SVR3_MMAP) - /* 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); @@ -945,5 +910,4 @@ DGAUnmapPhysical(DGAMapPtr pMap) close(pMap->fd); pMap->fd = -1; } -#endif } |