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 GetProcAddress(lib, "InitializeWinIo");
42 InitializeWinIo = (MYPROC) GetProcAddress(lib, "InitializeWinIo");
45 fprintf(stderr, "libpci: Couldn't find InitialieWinIo function.\n");
49 if (!InitializeWinIo())
51 fprintf(stderr, "libpci: InitializeWinIo() failed.\n");
57 return intel_iopl_set;
61 intel_cleanup_io(void)
63 //TODO: DeInitializeWinIo!
64 //intel_iopl_set = -1;