Add better number formatting to printf

This commit is contained in:
Justin C. Miller
2018-05-06 02:18:24 -07:00
parent f64efad057
commit d876aa141c
6 changed files with 31 additions and 24 deletions

View File

@@ -244,13 +244,13 @@ check_function(uint32_t *group, int bus, int dev, int func)
uint32_t header = (base[3] >> 16) & 0x7f;
bool multi = ((base[3] >> 16) & 0x80) == 0x80;
log::info(logs::devices, "Found PCIe device at %2d:%d:%d of type %d.%d id %x:%x",
log::info(logs::devices, "Found PCIe device at %02d:%02d:%d of type %d.%d id %04x:%04x",
bus, dev, func, devclass, subclass, vendor, device);
if (header == 0) {
log::debug(logs::devices, " Interrupt: %d", (base[15] >> 8) & 0xff);
for (int i = 0; i < 5; ++i)
log::debug(logs::devices, " BAR %d: %x", i + 1, base[i + 4]);
log::debug(logs::devices, " BAR %d: %08x", i + 1, base[i + 4]);
}
return multi;