Skip to content

Commit

Permalink
PCI: Adopt changes in ACPI definitions file
Browse files Browse the repository at this point in the history
  • Loading branch information
supercomputer7 authored and awesomekling committed Feb 28, 2020
1 parent b9c65ea commit f96cf25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Kernel/PCI/Initializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ PCI::Initializer::Initializer()
}
bool PCI::Initializer::test_acpi()
{
if ((KParams::the().has("noacpi")) || !ACPIParser::the().is_operable())
if ((KParams::the().has("noacpi")) || !ACPI::Parser::the().is_operable())
return false;
else
return true;
Expand All @@ -129,12 +129,12 @@ bool PCI::Initializer::test_pci_io()

bool PCI::Initializer::test_pci_mmio()
{
return !ACPIParser::the().find_table("MCFG").is_null();
return !ACPI::Parser::the().find_table("MCFG").is_null();
}

void PCI::Initializer::initialize_pci_mmio_access_after_test()
{
initialize_pci_mmio_access(ACPIParser::the().find_table("MCFG"));
initialize_pci_mmio_access(ACPI::Parser::the().find_table("MCFG"));
}

void PCI::Initializer::dismiss()
Expand Down
6 changes: 3 additions & 3 deletions Kernel/PCI/MMIOAccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ PCI::MMIOAccess::MMIOAccess(PhysicalAddress p_mcfg)
dbg() << "PCI: Checking MCFG Table length to choose the correct mapping size";
#endif

ACPI_RAW::SDTHeader* sdt = (ACPI_RAW::SDTHeader*)checkup_region->vaddr().offset(p_mcfg.offset_in_page().get()).as_ptr();
auto* sdt = (ACPI::Structures::SDTHeader*)checkup_region->vaddr().offset(p_mcfg.offset_in_page().get()).as_ptr();
u32 length = sdt->length;
u8 revision = sdt->revision;

Expand All @@ -75,12 +75,12 @@ PCI::MMIOAccess::MMIOAccess(PhysicalAddress p_mcfg)

auto mcfg_region = MM.allocate_kernel_region(p_mcfg.page_base(), PAGE_ROUND_UP(length) + PAGE_SIZE, "PCI Parsing MCFG", Region::Access::Read | Region::Access::Write);

auto& mcfg = *(ACPI_RAW::MCFG*)mcfg_region->vaddr().offset(p_mcfg.offset_in_page().get()).as_ptr();
auto& mcfg = *(ACPI::Structures::MCFG*)mcfg_region->vaddr().offset(p_mcfg.offset_in_page().get()).as_ptr();
#ifdef PCI_DEBUG
dbg() << "PCI: Checking MCFG @ V " << &mcfg << ", P 0x" << String::format("%x", p_mcfg.get());
#endif

for (u32 index = 0; index < ((mcfg.header.length - sizeof(ACPI_RAW::MCFG)) / sizeof(ACPI_RAW::PCI_MMIO_Descriptor)); index++) {
for (u32 index = 0; index < ((mcfg.header.length - sizeof(ACPI::Structures::MCFG)) / sizeof(ACPI::Structures::PCI_MMIO_Descriptor)); index++) {
u8 start_bus = mcfg.descriptors[index].start_pci_bus;
u8 end_bus = mcfg.descriptors[index].end_pci_bus;
u32 lower_addr = mcfg.descriptors[index].base_addr;
Expand Down

0 comments on commit f96cf25

Please sign in to comment.