Patch by Christopher Voltz, ported to the current tree by me.
Aix (via /dev/pci and odmget)
GNU Hurd (direct port access)
Windows (direct port access)
+ CYGWIN (direct port access)
It should be very easy to add support for other systems as well (volunteers
wanted; if you want to try that, I'll be very glad to see the patches and
init.o: init.c $(INCL)
access.o: access.c $(INCL)
params.o: params.c $(INCL)
-i386-ports.o: i386-ports.c $(INCL) i386-io-hurd.h i386-io-linux.h i386-io-sunos.h i386-io-windows.h
+i386-ports.o: i386-ports.c $(INCL) i386-io-hurd.h i386-io-linux.h i386-io-sunos.h i386-io-windows.h i386-io-cygwin.h
proc.o: proc.c $(INCL) pread.h
sysfs.o: sysfs.c $(INCL) pread.h
generic.o: generic.c $(INCL)
then
sys=freebsd
fi
+ if [ "$sys" = "CYGWIN_NT-5.1" ]
+ then
+ sys=cygwin
+ fi
HOST=${3:-$cpu-$sys}
fi
# CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless.
echo_n " i386-ports"
echo >>$c '#define PCI_HAVE_PM_INTEL_CONF'
;;
+ cygwin)
+ echo_n " i386-ports"
+ echo >>$c '#define PCI_HAVE_PM_INTEL_CONF'
+ echo >>$m 'LDLIBS+=-lioperm'
+ ;;
*)
echo " Unfortunately, your OS is not supported by the PCI Library"
exit 1
--- /dev/null
+/*
+ * The PCI Library -- Access to i386 I/O ports under Windows with CYGWIN
+ *
+ * Copyright (c) 1997--2006 Martin Mares <mj@ucw.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+#include <sys/io.h>
+
+static int
+intel_setup_io(struct pci_access *a UNUSED)
+{
+ return (iopl(3) < 0) ? 0 : 1;
+}
+
+static inline int
+intel_cleanup_io(struct pci_access *a UNUSED)
+{
+ iopl(3);
+ return -1;
+}
#include "i386-io-sunos.h"
#elif defined(PCI_OS_WINDOWS)
#include "i386-io-windows.h"
+#elif defined(PCI_OS_CYGWIN)
+#include "i386-io-cygwin.h"
#else
#error Do not know how to access I/O ports on this OS.
#endif