]> mj.ucw.cz Git - pciutils.git/commitdiff
Sparc/Sparc64 fixes by Jakub.
authorMartin Mares <mj@ucw.cz>
Mon, 26 Apr 1999 19:45:55 +0000 (19:45 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 5 May 2006 12:10:07 +0000 (14:10 +0200)
ChangeLog
lib/configure
lib/header.h
lspci.c

index d9c1d913e105dbe0e9b8f1a24267b0d8ec30a989..31de31f6e65d1b0c8c69fdf6322bc48c56601328 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Mon Apr 19 15:21:08 1999  Jakub Jelinek  <jj@ultra.linux.cz>
+
+       * lspci.c: Display I/O addresses correctly on sparc64.
+       * lib/header.h: Ditto.
+
+       * lib/configure: On sparc set HAVE_64BIT* as well, we want
+       a binary which works on both 32bit and 64bit SPARCs.
+
 Sun Apr 18 21:14:58 1999  Martin Mares  <mj@albireo.ucw.cz>
 
        * lspci.c, lib/proc.c: Alpha compilation fixes from Matthew Jacob
index 1858269c4115378f167dc031e7da7ee7d86d336c..3dfedcd9f68a2765389ef4d71b5d33c1b00bbd7a 100755 (executable)
@@ -27,11 +27,8 @@ case $cpu in
                        echo >>$c '#define HAVE_PM_INTEL_CONF'
                        ok=1
                        ;;
-       sparc)          echo -n " syscalls"
-                       echo >>$c '#define HAVE_PM_SYSCALLS'
-                       ok=1
-                       ;;
-       alpha|sparc64)  echo >>$c '#define HAVE_64BIT_ADDRESS'
+       alpha|sparc|sparc64)
+                       echo >>$c '#define HAVE_64BIT_ADDRESS'
 #                      echo -n " syscalls"
 #                      echo >>$c '#define HAVE_PM_SYSCALLS'
 #                      ok=1
index 2b0f608397046e2c88603460c6cc93de3a874bbb..7399184d869d68145ce126106db3dc40928ea35f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     $Id: header.h,v 1.2 1999/01/28 20:16:53 mj Exp $
+ *     $Id: header.h,v 1.3 1999/04/26 19:46:02 mj Exp $
  *
  *     The PCI Library -- PCI Header Structure (extracted from <linux/pci.h>)
  *
@@ -80,8 +80,8 @@
 #define  PCI_BASE_ADDRESS_MEM_TYPE_1M  0x02    /* Below 1M */
 #define  PCI_BASE_ADDRESS_MEM_TYPE_64  0x04    /* 64 bit address */
 #define  PCI_BASE_ADDRESS_MEM_PREFETCH 0x08    /* prefetchable? */
-#define  PCI_BASE_ADDRESS_MEM_MASK     (~0x0fUL)
-#define  PCI_BASE_ADDRESS_IO_MASK      (~0x03UL)
+#define  PCI_BASE_ADDRESS_MEM_MASK     (~0x0fL)
+#define  PCI_BASE_ADDRESS_IO_MASK      (~0x03L)
 /* bit 1 is reserved if address_space = 1 */
 
 /* Header type 0 (normal devices) */
diff --git a/lspci.c b/lspci.c
index ab987cde9a3356981fffa0700c966a73a32bee9e..07862ae33f4f25829c5079eac577d382e111906e 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -1,5 +1,5 @@
 /*
- *     $Id: lspci.c,v 1.24 1999/04/18 19:07:16 mj Exp $
+ *     $Id: lspci.c,v 1.25 1999/04/26 19:45:57 mj Exp $
  *
  *     Linux PCI Utilities -- List All PCI Devices
  *
@@ -62,6 +62,14 @@ static struct pci_access *pacc;
 #define ADDR_FORMAT "%08lx"
 #endif
 
+#ifdef ARCH_SPARC64
+#define IO_FORMAT "%016Lx"
+#elif defined(HAVE_64BIT_ADDRESS)
+#define IO_FORMAT "%04Lx"
+#else
+#define IO_FORMAT "%04lx"
+#endif
+
 /* Our view of the PCI bus */
 
 struct device {
@@ -259,10 +267,10 @@ show_bases(struct device *d, int cnt)
        }
       if (flg & PCI_BASE_ADDRESS_SPACE_IO)
        {
-         unsigned long a = pos & PCI_BASE_ADDRESS_IO_MASK;
+         pciaddr_t a = pos & PCI_BASE_ADDRESS_IO_MASK;
          printf("I/O ports at ");
          if (a)
-           printf("%04lx", a);
+           printf(IO_FORMAT, a);
          else if (flg & PCI_BASE_ADDRESS_IO_MASK)
            printf("<ignored>");
          else