From 668de76fa7743d3599ef1d350e54e963f30d1f77 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 18 Jul 2021 11:24:41 -0600 Subject: [PATCH] Kernel: Don't truncate physical address in ACPI table to 32 bits We need to cast physical addresses to PhysicalPtr instead of FlatPtr, which is currently always 64 bits. However, if one day we were to support 32 bit non-pae mode then it would also truncate appropriately. --- Kernel/ACPI/Parser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel/ACPI/Parser.cpp b/Kernel/ACPI/Parser.cpp index 82c7bcafc1..b138547fda 100644 --- a/Kernel/ACPI/Parser.cpp +++ b/Kernel/ACPI/Parser.cpp @@ -408,8 +408,8 @@ UNMAP_AFTER_INIT static PhysicalAddress search_table_in_xsdt(PhysicalAddress xsd auto xsdt = map_typed(xsdt_address); for (size_t i = 0; i < ((xsdt->h.length - sizeof(Structures::SDTHeader)) / sizeof(u64)); ++i) { - if (match_table_signature(PhysicalAddress((FlatPtr)xsdt->table_ptrs[i]), signature)) - return PhysicalAddress((FlatPtr)xsdt->table_ptrs[i]); + if (match_table_signature(PhysicalAddress((PhysicalPtr)xsdt->table_ptrs[i]), signature)) + return PhysicalAddress((PhysicalPtr)xsdt->table_ptrs[i]); } return {}; } @@ -431,8 +431,8 @@ UNMAP_AFTER_INIT static PhysicalAddress search_table_in_rsdt(PhysicalAddress rsd auto rsdt = map_typed(rsdt_address); for (u32 i = 0; i < ((rsdt->h.length - sizeof(Structures::SDTHeader)) / sizeof(u32)); i++) { - if (match_table_signature(PhysicalAddress((FlatPtr)rsdt->table_ptrs[i]), signature)) - return PhysicalAddress((FlatPtr)rsdt->table_ptrs[i]); + if (match_table_signature(PhysicalAddress((PhysicalPtr)rsdt->table_ptrs[i]), signature)) + return PhysicalAddress((PhysicalPtr)rsdt->table_ptrs[i]); } return {}; }