From dec169431690367d480477026710db17ae4f0ef8 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 26 Apr 1999 19:45:55 +0000 Subject: [PATCH] Sparc/Sparc64 fixes by Jakub. --- ChangeLog | 8 ++++++++ lib/configure | 7 ++----- lib/header.h | 6 +++--- lspci.c | 14 +++++++++++--- 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index d9c1d91..31de31f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Apr 19 15:21:08 1999 Jakub Jelinek + + * 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 * lspci.c, lib/proc.c: Alpha compilation fixes from Matthew Jacob diff --git a/lib/configure b/lib/configure index 1858269..3dfedcd 100755 --- a/lib/configure +++ b/lib/configure @@ -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 diff --git a/lib/header.h b/lib/header.h index 2b0f608..7399184 100644 --- a/lib/header.h +++ b/lib/header.h @@ -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 ) * @@ -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 ab987cd..07862ae 100644 --- 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(""); else -- 2.39.2