+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.
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"
;;
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'
ok=1
;;
GNU)
- echo_n " intel-conf"
+ echo_n " i386-ports"
echo >>$c '#define HAVE_PM_INTEL_CONF'
ok=1
;;
#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
#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