]> mj.ucw.cz Git - pciutils.git/commitdiff
Added support for SunOS/i386
authorMartin Mares <mj@ucw.cz>
Fri, 26 Dec 2003 23:13:13 +0000 (23:13 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 5 May 2006 12:18:11 +0000 (14:18 +0200)
Merged support for Solaris on i386 by Bill Moore <billm@eng.sun.com>
and cleaned up:

* lib/configure: Recognize SunOS.
* lib/internal.h: Learn how to recognize byte order on SunOS.
* lib/i386-ports.c: Split OS-dependent I/O port access from i386-ports.c.
* lib/i386-io-linux.h: Linux specific part.
* lib/i386-io-hurd.h: GNU/Hurd specific part.
* lib/i386-io-sunos.h: SunOS specific part.
git-archimport-id: mj@ucw.cz--public/pciutils--main--2.2--patch-18

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

index bc5648c59f61cd6c4a6c636afd8c4c573773817b..e48b7f13cb60cd71f3fa6cb30541ccd78e3d46ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2003-12-27  Martin Mares  <mj@ucw.cz>
+
+       Merged support for Solaris on i386 by Bill Moore <billm@eng.sun.com>
+       and cleaned up:
+
+       * lib/configure: Recognize SunOS.
+       * lib/internal.h: Learn how to recognize byte order on SunOS.
+       * lib/i386-ports.c: Split OS-dependent I/O port access from i386-ports.c.
+       * lib/i386-io-linux.h: Linux specific part.
+       * lib/i386-io-hurd.h: GNU/Hurd specific part.
+       * lib/i386-io-sunos.h: SunOS specific part.
+
 2003-12-26  Martin Mares  <mj@ucw.cz>
 
        * lib/header.h (PCI_*_MASK): Cast to pciaddr_t explicitly.
index 43f7c5fd1f74f62d80d6710712e7541427082df3..9ac29839f7b6efb02e2974f5573cc301acfb8dbc 100755 (executable)
@@ -20,7 +20,7 @@ then
        proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
        cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
 else
-       cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`
+       cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/'`
 fi
 echo " $sys/$cpu $rel"
 
@@ -50,6 +50,19 @@ case $sys in
                                                ;;
                esac
                ;;
+       SunOS)
+               case $cpu in
+                               i386)           echo_n " i386-ports"
+                                               echo >>$c "#define HAVE_PM_INTEL_CONF"
+                                               ok=1
+                                               ;;
+                               *)
+                                               echo " The PCI library is does not support Solaris for this architecture: $cpu"
+                                               exit 1
+                                               ;;
+               esac
+               ;;
+               
        FreeBSD)
                echo_n " fbsd-device"
                echo >>$c '#define HAVE_PM_FBSD_DEVICE'
@@ -68,7 +81,7 @@ case $sys in
                ok=1
                ;;
        GNU)
-               echo_n " intel-conf"
+               echo_n " i386-ports"
                echo >>$c '#define HAVE_PM_INTEL_CONF'
                ok=1
                ;;
index 6aacd9cf0a8f45690fb2880f5f9314dee980c3fb..ada1ee1c5accea0a475598b05413b1415c397088 100644 (file)
@@ -8,47 +8,16 @@
 
 #include <unistd.h>
 
-#ifdef __GLIBC__
-#include <sys/io.h>
-#else
-#include <asm/io.h>
-#endif
-
 #include "internal.h"
 
-#ifdef OS_LINUX
-static int intel_iopl_set = -1;
-
-static int
-intel_setup_io(void)
-{
-  if (intel_iopl_set < 0)
-    intel_iopl_set = (iopl(3) < 0) ? 0 : 1;
-  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)
-{
-}
+#if defined(OS_LINUX)
+#include "i386-io-linux.h"
+#elif defined(OS_GNU)
+#include "i386-io-hurd.h"
+#elif defined(OS_SunOS)
+#include "i386-io-sunos.h"
+#else
+#error Do not know how to access I/O ports on this OS.
 #endif
 
 static void
index 3c6187ef230bc83f871b95504ecd35da8280b329..63f3c9ebaeb2b7f85efa201044ba90e5c2030bd1 100644 (file)
 #include <sys/types.h>
 #endif
 
+#ifdef OS_SunOS
+#include <sys/byteorder.h>
+#define BIG_ENDIAN 4321
+#ifdef _LITTLE_ENDIAN
+#define BYTE_ORDER 1234
+#else
+#define BYTE_ORDER 4321
+#endif
+#endif
+
 #if BYTE_ORDER == BIG_ENDIAN
 #define cpu_to_le16 swab16
 #define cpu_to_le32 swab32