3 $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
4 Modified for readability by Nick Kurshev
6 #define INCL_DOSFILEMGR
9 static USHORT callgate
[3] = {0,0,0};
11 static __inline__
int enable_os_io(void)
16 static char *ioDrvPath
= "/dev/fastio$";
18 if (DosOpen((PSZ
)ioDrvPath
, (PHFILE
)&hfd
, (PULONG
)&action
,
19 (ULONG
)0, FILE_SYSTEM
, FILE_OPEN
,
20 OPEN_SHARE_DENYNONE
|OPEN_FLAGS_NOINHERIT
|OPEN_ACCESS_READONLY
,
22 fprintf(stderr
,"Error opening fastio$ driver...\n");
23 fprintf(stderr
,"Please install xf86sup.sys in config.sys!\n");
26 callgate
[0] = callgate
[1] = 0;
28 /* Get callgate from driver for fast io to ports and other stuff */
30 rc
= DosDevIOCtl(hfd
, (ULONG
)0x76, (ULONG
)0x64,
32 (ULONG
*)&callgate
[2], sizeof(USHORT
), &dlen
);
34 fprintf(stderr
,"xf86-OS/2: EnableIOPorts failed, rc=%d, dlen=%d; emergency exit\n",
40 /* Calling callgate with function 13 sets IOPL for the program */
42 asm volatile ("movl $13,%%ebx;.byte 0xff,0x1d;.long _callgate"
45 : "eax","ebx","ecx","edx","cc");
51 static __inline__
int disable_os_io(void)