summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-07-17 18:42:33 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-07-17 18:42:33 -0700
commitb512d07b3125ed3ec5ae962ebb1a01d007d0efe9 (patch)
tree572636eb635503df8a4bf3f376aeb61535a1d4c1
parentfd5436d2ef3484a0eaec619cf69870c18d7cb3ca (diff)
unifdef __UNIXOS2__
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/XF86DGA.c54
-rw-r--r--src/XF86DGA2.c50
2 files changed, 4 insertions, 100 deletions
diff --git a/src/XF86DGA.c b/src/XF86DGA.c
index 24d9369..622095c 100644
--- a/src/XF86DGA.c
+++ b/src/XF86DGA.c
@@ -8,12 +8,6 @@ Copyright (c) 1995,1996 The XFree86 Project, Inc
/* THIS IS NOT AN X CONSORTIUM STANDARD */
-#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
#if defined(linux)
#define HAS_MMAP_ANON
@@ -361,9 +355,7 @@ Bool XF86DGAViewPortChanged(
# include <errno.h>
# include <smem.h>
# else
-# if !defined(__UNIXOS2__)
-# include <sys/mman.h>
-# endif
+# include <sys/mman.h>
# endif
#endif
#include <sys/wait.h>
@@ -469,10 +461,6 @@ MapPhysAddress(unsigned long address, unsigned long size)
MapPtr mp;
#if defined(ISC) && defined(HAS_SVR3_MMAP)
struct kd_memloc mloc;
-#elif defined(__UNIXOS2__)
- APIRET rc;
- ULONG action;
- HFILE hfd;
#endif
if ((mp = FindMap(address, size))) {
@@ -513,40 +501,6 @@ MapPhysAddress(unsigned long address, unsigned long size)
if ((vaddr = (void *)ioctl(mapFd, MAP, &mloc)) == (void *)-1)
return NULL;
-#elif defined (__UNIXOS2__)
- /*
- * Dragon warning here! /dev/pmap$ is never closed, except on program exit.
- * Consecutive calling of this routine will make PMAP$ driver run out
- * of memory handles. Some umap/close mechanism should be provided
- */
-
- rc = DosOpen("/dev/pmap$", &hfd, &action, 0, FILE_NORMAL, FILE_OPEN,
- OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, (PEAOP2)NULL);
- if (rc != 0)
- return NULL;
- {
- struct map_ioctl {
- union {
- ULONG phys;
- void* user;
- } a;
- ULONG size;
- } pmap,dmap;
- ULONG plen,dlen;
-#define XFREE86_PMAP 0x76
-#define PMAP_MAP 0x44
-
- pmap.a.phys = offset;
- pmap.size = size + delta;
- rc = DosDevIOCtl(hfd, XFREE86_PMAP, PMAP_MAP,
- (PULONG)&pmap, sizeof(pmap), &plen,
- (PULONG)&dmap, sizeof(dmap), &dlen);
- if (rc == 0) {
- vaddr = dmap.a.user;
- }
- }
- if (rc != 0)
- return NULL;
#elif defined(Lynx) && defined(NO_MMAP)
vaddr = (void *)smem_create("XF86DGA", (char *)offset,
size + delta, SM_READ|SM_WRITE);
@@ -623,15 +577,13 @@ XF86DGADirectVideo(
if (enable & XF86DGADirectGraphics) {
#if !defined(ISC) && !defined(HAS_SVR3_MMAP) \
- && !(defined(Lynx) && defined(NO_MMAP)) \
- && !defined(__UNIXOS2__)
+ && !(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)) \
- && !defined(__UNIXOS2__)
+ && !(defined(Lynx) && defined(NO_MMAP))
if (mp && mp->vaddr)
mprotect(mp->vaddr, mp->size + mp->delta, PROT_READ);
#elif defined(Lynx) && defined(NO_MMAP)
diff --git a/src/XF86DGA2.c b/src/XF86DGA2.c
index fc5b9ce..9f13faf 100644
--- a/src/XF86DGA2.c
+++ b/src/XF86DGA2.c
@@ -10,12 +10,6 @@ Copyright (c) 1995,1996 The XFree86 Project, Inc
#include <config.h>
#endif
-#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
#include <X11/Xlibint.h>
#include <X11/extensions/Xxf86dga.h>
@@ -762,9 +756,7 @@ void XDGAKeyEventToXKeyEvent(
# include <errno.h>
# include <smem.h>
# else
-# if !defined(__UNIXOS2__)
-# include <sys/mman.h>
-# endif
+# include <sys/mman.h>
# endif
#endif
#include <sys/wait.h>
@@ -894,10 +886,6 @@ DGAMapPhysical(
) {
#if defined(ISC) && defined(HAS_SVR3_MMAP)
struct kd_memloc mloc;
-#elif defined(__UNIXOS2__)
- APIRET rc;
- ULONG action;
- HFILE hfd;
#endif
base += offset;
@@ -916,40 +904,6 @@ DGAMapPhysical(
if ((pMap->virtual = (void *)ioctl(pMap->fd, MAP, &mloc)) == (void *)-1)
return False;
-#elif defined (__UNIXOS2__)
- /*
- * Dragon warning here! /dev/pmap$ is never closed, except on program exit.
- * Consecutive calling of this routine will make PMAP$ driver run out
- * of memory handles. Some umap/close mechanism should be provided
- */
-
- rc = DosOpen("/dev/pmap$", &hfd, &action, 0, FILE_NORMAL, FILE_OPEN,
- OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, (PEAOP2)NULL);
- if (rc != 0)
- return False;
- {
- struct map_ioctl {
- union {
- ULONG phys;
- void* user;
- } a;
- ULONG size;
- } pmap,dmap;
- ULONG plen,dlen;
-#define XFREE86_PMAP 0x76
-#define PMAP_MAP 0x44
-
- pmap.a.phys = base;
- pmap.size = size;
- rc = DosDevIOCtl(hfd, XFREE86_PMAP, PMAP_MAP,
- (PULONG)&pmap, sizeof(pmap), &plen,
- (PULONG)&dmap, sizeof(dmap), &dlen);
- if (rc == 0) {
- pMap->virtual = dmap.a.user;
- }
- }
- if (rc != 0)
- return False;
#elif defined (Lynx) && defined(NO_MMAP)
pMap->virtual = smem_create("XF86DGA", (char*)base, size, SM_READ|SM_WRITE);
#else
@@ -977,8 +931,6 @@ DGAUnmapPhysical(DGAMapPtr pMap)
{
#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);