2 * The PCI Library -- Access to i386 I/O ports on Windows
4 * Copyright (c) 2004 Alexander Stock <stock.alexander@gmx.de>
6 * Can be freely distributed and used under the terms of the GNU GPL.
13 #define outb(x,y) _outp(y,x)
14 #define outw(x,y) _outpw(y,x)
15 #define outl(x,y) _outpd(y,x)
17 #define inb(x) _inp(x)
18 #define inw(x) _inpw(x)
19 #define inl(x) _inpd(x)
21 static int intel_iopl_set = -1;
26 if (intel_iopl_set < 0)
28 typedef int (*MYPROC)(void);
29 MYPROC InitializeWinIo;
34 lib = LoadLibrary("WinIo.dll");
37 fprintf(stderr, "libpci: Couldn't load WinIo.dll.\n");
40 /* XXX: Is this really needed? --mj */
41 GetProcAddress(lib, "InitializeWinIo");
43 InitializeWinIo = (MYPROC) GetProcAddress(lib, "InitializeWinIo");
46 fprintf(stderr, "libpci: Couldn't find InitializeWinIo function.\n");
50 if (!InitializeWinIo())
52 fprintf(stderr, "libpci: InitializeWinIo() failed.\n");
58 return intel_iopl_set;
62 intel_cleanup_io(void)
64 //TODO: DeInitializeWinIo!
65 //intel_iopl_set = -1;