Fix core dump after printing usage message (pointed out by BDE).

Add printing of PCI header type register. (This makes the output
80 columns wide. Ughh. I'm looking for a better way to put the
information on one line ...)
This commit is contained in:
Stefan Eßer 1996-11-16 22:05:52 +00:00
parent e534982b63
commit b1427fd412
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19817

View File

@ -53,6 +53,7 @@ usage(const char *argv0) {
fprintf(stderr, "usage:\n\t%s -l\n"
"\t%s [-r|-w] [-bh] sel addr [value]\n",
argv0, argv0);
exit (1);
}
int
@ -131,10 +132,10 @@ list_devs(void)
close(fd);
for (p = conf; p < &conf[pc.pci_len / sizeof conf[0]]; p++) {
printf("pci%d:%d:%d:\tclass=0x%06x card=0x%08lx chip=0x%08lx rev=0x%02x\n",
printf("pci%d:%d:%d:\tclass=0x%06x card=0x%08lx chip=0x%08lx rev=0x%02x hdr=0x%02x\n",
p->pc_sel.pc_bus, p->pc_sel.pc_dev, p->pc_sel.pc_func,
p->pc_class >> 8, p->pc_subid,
p->pc_devid, p->pc_class & 0xff);
p->pc_devid, p->pc_class & 0xff, p->pc_hdr);
}
}