[Yellowstone] Disable most log messages in yellowstone.

This commit is contained in:
Drew Galbraith 2023-11-15 16:26:08 -08:00
parent c080c61398
commit 1ccbf5e12e
3 changed files with 16 additions and 10 deletions

View file

@ -4,6 +4,8 @@
#include <mammoth/init.h>
#include <zcall.h>
#define PCI_DEBUG 0
namespace {
PciDeviceHeader* PciHeader(uint64_t base, uint64_t bus, uint64_t dev,
@ -15,14 +17,10 @@ PciDeviceHeader* PciHeader(uint64_t base, uint64_t bus, uint64_t dev,
} // namespace
PciReader::PciReader() {
dbgln("Creating addr space");
uint64_t vaddr;
check(ZAddressSpaceMap(gSelfVmasCap, 0, gBootPciVmmoCap, &vaddr));
dbgln("Addr {x}", vaddr);
dbgln("Dumping PCI");
PciDump(vaddr);
dbgln("Done");
header_ = PciHeader(vaddr, 0, 0, 0);
}
@ -40,17 +38,21 @@ void PciReader::FunctionDump(uint64_t base, uint64_t bus, uint64_t dev,
if (hdr->vendor_id == 0xFFFF) {
return;
}
#if PCI_DEBUG
dbgln(
"[{}.{}.{}] (Vendor, Device): ({x}, {x}), (Type, Class, Sub, PIF): ({}, "
"{x}, {x}, {x})",
bus, dev, fun, hdr->vendor_id, hdr->device_id, hdr->header_type,
hdr->class_code, hdr->subclass, hdr->prog_interface);
#endif
if ((hdr->class_code == 0x6) && (hdr->subclass == 0x4)) {
dbgln("FIXME: Handle PCI to PCI bridge.");
}
if (hdr->class_code == 0x1) {
#if PCI_DEBUG
dbgln("SATA Device at: {x}", reinterpret_cast<uint64_t>(hdr) - base);
#endif
achi_device_offset_ = reinterpret_cast<uint64_t>(hdr) - base;
}
}