]> mj.ucw.cz Git - pciutils.git/commitdiff
Added support for GNU Hurd
authorMartin Mares <mj@ucw.cz>
Fri, 26 Dec 2003 22:07:54 +0000 (22:07 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 5 May 2006 12:18:11 +0000 (14:18 +0200)
2003-12-26  Marco Gerards  <metgerards@student.han.nl>

        Added support for the GNU Hurd (cleaned up by Martin Mares):

        * lib/configure [GNU]: Use the i386 ports for configuration access.
        * lib/i386-ports.c: Don't call iopl() on the Hurd.
        * lib/pci.h [OS_GNU]: Include <sys/types.h> and use it for defining
        u8 to u32.
git-archimport-id: mj@ucw.cz--public/pciutils--main--2.2--patch-16

ChangeLog
lib/configure
lib/i386-ports.c
lib/pci.h

index 4e4e361fe747292c08eef50f72ca7bfcab1628cc..1931228aa4acc378872a3ba296bc25fd39dbb651 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2003-12-26  Marco Gerards  <metgerards@student.han.nl>
+
+       Added support for the GNU Hurd (cleaned up by Martin Mares):
+
+       * lib/configure [GNU]: Use the i386 ports for configuration access.
+       * lib/i386-ports.c: Don't call iopl() on the Hurd.
+       * lib/pci.h [OS_GNU]: Include <sys/types.h> and use it for defining
+       u8 to u32.
+
 2003-12-26  Martin Mares  <mj@ucw.cz>
 
        * lspci.c (show_pcix_bridge, show_pcix_nobridge): Don't forget to call
index 0f791cc74581281c243e57f7d4d7e053afa79aa2..c169c8bc5fd16b43590fc68d1e72d62f2943a60c 100755 (executable)
@@ -69,8 +69,13 @@ case $sys in
                echo >>$c '#define PATH_NBSD_DEVICE "/dev/pci0"'
                ok=1
                ;;
+       GNU)
+               echo_n " intel-conf"
+               echo >>$c '#define HAVE_PM_INTEL_CONF'
+               ok=1
+               ;;
         *)
-               echo " The PCI library currently supports only Linux, AIX, FreeBSD and NetBSD"
+               echo " Unfortunately, your OS is not supported by the PCI Library"
                exit 1
                ;;
 esac
index b0d05c49fb12197bab8a0a9208ea087ee3e33ca9..6aacd9cf0a8f45690fb2880f5f9314dee980c3fb 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "internal.h"
 
+#ifdef OS_LINUX
 static int intel_iopl_set = -1;
 
 static int
@@ -26,6 +27,30 @@ intel_setup_io(void)
   return intel_iopl_set;
 }
 
+static inline void
+intel_cleanup_io(void)
+{
+  if (intel_iopl_set > 0)
+    iopl(3);
+  intel_iopl_set = -1;
+}
+#endif
+
+#ifdef OS_GNU
+/* The GNU Hurd doesn't have an iopl() call */
+
+static inline int
+intel_setup_io(void)
+{
+  return 1;
+}
+
+static inline int
+intel_cleanup_io(void)
+{
+}
+#endif
+
 static void
 conf12_init(struct pci_access *a)
 {
@@ -36,8 +61,7 @@ conf12_init(struct pci_access *a)
 static void
 conf12_cleanup(struct pci_access *a UNUSED)
 {
-  iopl(3);
-  intel_iopl_set = -1;
+  intel_cleanup_io();
 }
 
 /*
index 7bd56504f2655177881401ef9b120933f058962f..263f3e77fd88024cc268e4978ec00076e5d26e69 100644 (file)
--- a/lib/pci.h
+++ b/lib/pci.h
@@ -24,6 +24,7 @@ typedef __u8 u8;
 typedef __u16 word;
 typedef __u16 u16;
 typedef __u32 u32;
+
 #endif
 
 #ifdef OS_FREEBSD
@@ -56,6 +57,16 @@ typedef u_int16_t u16;
 typedef u_int32_t u32;
 #endif
 
+#ifdef OS_GNU
+#include <sys/types.h>
+
+typedef u_int8_t byte;
+typedef u_int8_t u8;
+typedef u_int16_t word;
+typedef u_int16_t u16;
+typedef u_int32_t u32;
+#endif
+
 #ifdef HAVE_LONG_ADDRESS
 typedef unsigned long long pciaddr_t;
 #else