1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:18:13 +00:00

LibBareMetal: Return FlatPtr from PhysicalAddress::offset_in_page()

This commit is contained in:
Liav A 2020-03-08 18:29:48 +02:00 committed by Andreas Kling
parent 1c83c5ed08
commit 032ce1948e
5 changed files with 22 additions and 22 deletions

View file

@ -66,7 +66,7 @@ PCI::MMIOAccess::MMIOAccess(PhysicalAddress p_mcfg)
dbg() << "PCI: Checking MCFG Table length to choose the correct mapping size";
#endif
auto* sdt = (ACPI::Structures::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()).as_ptr();
u32 length = sdt->length;
u8 revision = sdt->revision;
@ -75,7 +75,7 @@ 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::Structures::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()).as_ptr();
#ifdef PCI_DEBUG
dbg() << "PCI: Checking MCFG @ V " << &mcfg << ", P 0x" << String::format("%x", p_mcfg.get());
#endif