2 * The PCI Library -- Access to i386 I/O ports on Windows
4 * Copyright (c) 2004 Alexander Stock <stock.alexander@gmx.de>
5 * Copyright (c) 2006 Martin Mares <mj@ucw.cz>
7 * Can be freely distributed and used under the terms of the GNU GPL.
16 int _outp(unsigned short port, int databyte);
17 unsigned short _outpw(unsigned short port, unsigned short dataword);
18 unsigned long _outpd(unsigned short port, unsigned long dataword);
19 int _inp(unsigned short port);
20 unsigned short _inpw(unsigned short port);
21 unsigned long _inpd(unsigned short port);
24 #define outb(x,y) _outp(y,x)
25 #define outw(x,y) _outpw(y,x)
26 #define outl(x,y) _outpd(y,x)
28 #define inb(x) _inp(x)
29 #define inw(x) _inpw(x)
30 #define inl(x) _inpd(x)
33 intel_setup_io(struct pci_access *a)
35 typedef int (*MYPROC)(void);
36 MYPROC InitializeWinIo;
39 lib = LoadLibrary("WinIo.dll");
42 a->warning("i386-io-windows: Couldn't load WinIo.dll.");
45 /* XXX: Is this really needed? --mj */
46 GetProcAddress(lib, "InitializeWinIo");
48 InitializeWinIo = (MYPROC) GetProcAddress(lib, "InitializeWinIo");
51 a->warning("i386-io-windows: Couldn't find InitializeWinIo function.");
55 if (!InitializeWinIo())
57 a->warning("i386-io-windows: InitializeWinIo() failed.");
65 intel_cleanup_io(struct pci_access *a UNUSED)
67 //TODO: DeInitializeWinIo!