From: Martin Mares Date: Fri, 26 Dec 2003 22:07:54 +0000 (+0000) Subject: Added support for GNU Hurd X-Git-Tag: v3.0.0~149 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=80459c650b9739e06a8662e395a27ac481e2de3a;p=pciutils.git Added support for GNU Hurd 2003-12-26 Marco Gerards 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 and use it for defining u8 to u32. git-archimport-id: mj@ucw.cz--public/pciutils--main--2.2--patch-16 --- diff --git a/ChangeLog b/ChangeLog index 4e4e361..1931228 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2003-12-26 Marco Gerards + + 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 and use it for defining + u8 to u32. + 2003-12-26 Martin Mares * lspci.c (show_pcix_bridge, show_pcix_nobridge): Don't forget to call diff --git a/lib/configure b/lib/configure index 0f791cc..c169c8b 100755 --- a/lib/configure +++ b/lib/configure @@ -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 diff --git a/lib/i386-ports.c b/lib/i386-ports.c index b0d05c4..6aacd9c 100644 --- a/lib/i386-ports.c +++ b/lib/i386-ports.c @@ -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(); } /* diff --git a/lib/pci.h b/lib/pci.h index 7bd5650..263f3e7 100644 --- 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 + +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