OSDN Git Service

Fix Sun bug #7035791: scanpci should report 64 bit registers
authorJohn Martin <John.M.Martin@Oracle.COM>
Sat, 20 Jul 2013 22:49:05 +0000 (15:49 -0700)
committerAlan Coopersmith <alan.coopersmith@oracle.com>
Sat, 20 Jul 2013 22:53:08 +0000 (15:53 -0700)
On a system which has allocated 64-bit device addresses scanpci -v
will show entries such as:
[...]
  BASE0     0xce000000 SIZE 16777216  MEM
  BASE1     0x00000fc1f8000000 SIZE 134217728  MEM64 PREFETCHABLE
  BASE3     0x00000fc1f6000000 SIZE 33554432  MEM64 PREFETCHABLE
[...]
instead of:
[...]
  BASE0     0xce000000 SIZE 16777216  MEM
  BASE1     0xf8000000 SIZE 134217728  MEM PREFETCHABLE
  BASE3     0xf6000000 SIZE 33554432  MEM PREFETCHABLE
[...]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
scanpci/scanpci.c

index a427692..2f86833 100644 (file)
@@ -152,11 +152,13 @@ print_pci_device( struct pci_device * dev, int verbose )
        pci_device_probe( dev );
        for ( i = 0 ; i < 6 ; i++ ) {
            if ( dev->regions[i].base_addr != 0 ) {
-               printf( "  BASE%u     0x%08"PRIxPTR" SIZE %zu  %s",
+               printf( "  BASE%u     0x%0*"PRIxPTR" SIZE %zu  %s",
                        i,
+                       dev->regions[i].is_64 ? 16 : 8,
                        (intptr_t) dev->regions[i].base_addr,
                        (size_t) dev->regions[i].size,
-                       (dev->regions[i].is_IO) ? "I/O" : "MEM" );
+                       (dev->regions[i].is_IO) ? "I/O" :
+                       ((dev->regions[i].is_64) ? "MEM64" : "MEM"));
 
                if ( ! dev->regions[i].is_IO ) {
                    if ( dev->regions[i].is_prefetchable ) {