27 lines
511 B
C

#include <lcrash/pci/pci.h>
#include <lcrash/acpi/acpi.h>
#include <lcrash/debug/debug.h>
bool PciIsPresent = false;
bool PciSupportsECM = false;
void PciInitialize() {
// Try to figure out if we have PCIe
if (AcpiPresent()) {
struct AcpiMCFG* BridgeTable = AcpiGetTable("MCFG");
// Guess not
if (BridgeTable == NULL) goto nopcie;
while (1) {}
}
nopcie: Panic("Failed to initialize PCI");
return;
}
bool PciPresent() { return PciIsPresent; }
bool PciePresent() { return PciSupportsECM; }