summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pciconf
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2002-02-26 10:40:42 +0000
committersos <sos@FreeBSD.org>2002-02-26 10:40:42 +0000
commit673b8cea9ce139961c82bfd6998e201b31fa5cb3 (patch)
treea88e7575c924ddf4f4bd287cd61085669ddad69b /usr.sbin/pciconf
parentd4b125fae21d3919e51ecbc1876fd21110763966 (diff)
downloadFreeBSD-src-673b8cea9ce139961c82bfd6998e201b31fa5cb3.zip
FreeBSD-src-673b8cea9ce139961c82bfd6998e201b31fa5cb3.tar.gz
When asked to print bytes (-b option) do that and put 16 on a line.
Diffstat (limited to 'usr.sbin/pciconf')
-rw-r--r--usr.sbin/pciconf/pciconf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c
index d42759c..6a18b6d 100644
--- a/usr.sbin/pciconf/pciconf.c
+++ b/usr.sbin/pciconf/pciconf.c
@@ -460,7 +460,7 @@ readone(int fd, struct pcisel *sel, long reg, int width)
if (ioctl(fd, PCIOCREAD, &pi) < 0)
err(1, "ioctl(PCIOCREAD)");
- printf("0x%08x", pi.pi_data);
+ printf("%0*x", width*2, pi.pi_data);
}
static void
@@ -486,9 +486,10 @@ readit(const char *name, const char *reg, int width)
sel = getsel(name);
for (i = 1, r = rstart; r <= rend; i++, r += width) {
readone(fd, &sel, r, width);
- putchar(i % 4 ? ' ' : '\n');
+ if (i && !(i % 8)) putchar(' ');
+ putchar(i % (16/width) ? ' ' : '\n');
}
- if (i % 4 != 1)
+ if (i % (16/width) != 1)
putchar('\n');
close(fd);
}
OpenPOWER on IntegriCloud