*/
#include <io.h>
-#include <conio.h>
#include <windows.h>
+#ifndef __GNUC__
+#include <conio.h>
+#else
+int _outp(unsigned short port, int databyte);
+unsigned short _outpw(unsigned short port, unsigned short dataword);
+unsigned long _outpd(unsigned short port, unsigned long dataword);
+int _inp(unsigned short port);
+unsigned short _inpw(unsigned short port);
+unsigned long _inpd(unsigned short port);
+#endif
+
#define outb(x,y) _outp(y,x)
#define outw(x,y) _outpw(y,x)
#define outl(x,y) _outpd(y,x)
MYPROC InitializeWinIo;
HMODULE lib;
- intel_iopl_set = 0;
+#ifndef _WIN64
+ /* 16/32-bit non-NT systems allow applications to access PCI I/O ports without any special setup. */
+ OSVERSIONINFOA version;
+ version.dwOSVersionInfoSize = sizeof(version);
+ if (GetVersionExA(&version) && version.dwPlatformId < VER_PLATFORM_WIN32_NT)
+ {
+ a->debug("Detected 16/32-bit non-NT system, skipping NT setup...");
+ return 1;
+ }
+#endif
lib = LoadLibrary("WinIo.dll");
if (!lib)
//TODO: DeInitializeWinIo!
return 1;
}
+
+static inline void intel_io_lock(void)
+{
+}
+
+static inline void intel_io_unlock(void)
+{
+}