diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-08 10:36:51 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-08 13:06:51 +0100 |
commit | b1058b33fb32cb398d1723eb6fe59c27dc7967cc (patch) | |
tree | 49f0e5af7b7e37afd80a6dedf655917bf51ed915 /Kernel/ACPI/ACPIStaticParser.cpp | |
parent | b98d8ad5b01c41efff24faffe94918435194257a (diff) | |
download | serenity-b1058b33fb32cb398d1723eb6fe59c27dc7967cc.zip |
AK: Add global FlatPtr typedef. It's u32 or u64, based on sizeof(void*)
Use this instead of uintptr_t throughout the codebase. This makes it
possible to pass a FlatPtr to something that has u32 and u64 overloads.
Diffstat (limited to 'Kernel/ACPI/ACPIStaticParser.cpp')
-rw-r--r-- | Kernel/ACPI/ACPIStaticParser.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Kernel/ACPI/ACPIStaticParser.cpp b/Kernel/ACPI/ACPIStaticParser.cpp index eb97518574..a55c16c7e0 100644 --- a/Kernel/ACPI/ACPIStaticParser.cpp +++ b/Kernel/ACPI/ACPIStaticParser.cpp @@ -247,7 +247,7 @@ namespace ACPI { dbg() << "ACPI: Looking for RSDP in EBDA @ V " << (void*)rsdp_str << ", P " << (void*)p_rsdp_str; #endif if (!strncmp("RSD PTR ", rsdp_str, strlen("RSD PTR "))) - return PhysicalAddress((uintptr_t)p_rsdp_str); + return PhysicalAddress((FlatPtr)p_rsdp_str); p_rsdp_str += 16; } return {}; @@ -262,7 +262,7 @@ namespace ACPI { dbg() << "ACPI: Looking for RSDP in BIOS ROM area @ V " << (void*)rsdp_str << ", P " << (void*)p_rsdp_str; #endif if (!strncmp("RSD PTR ", rsdp_str, strlen("RSD PTR "))) - return PhysicalAddress((uintptr_t)p_rsdp_str); + return PhysicalAddress((FlatPtr)p_rsdp_str); p_rsdp_str += 16; } return {}; @@ -320,8 +320,8 @@ namespace ACPI { auto main_sdt_region = MM.allocate_kernel_region(xsdt.page_base(), PAGE_SIZE, "ACPI Static Parsing search_table_in_xsdt()", Region::Access::Read, false, true); auto* xsdt_ptr = (volatile Structures::XSDT*)main_sdt_region->vaddr().offset(xsdt.offset_in_page().get()).as_ptr(); for (u32 i = 0; i < ((xsdt_ptr->h.length - sizeof(Structures::SDTHeader)) / sizeof(u64)); i++) { - if (match_table_signature(PhysicalAddress((uintptr_t)xsdt_ptr->table_ptrs[i]), signature)) - return PhysicalAddress((uintptr_t)xsdt_ptr->table_ptrs[i]); + if (match_table_signature(PhysicalAddress((FlatPtr)xsdt_ptr->table_ptrs[i]), signature)) + return PhysicalAddress((FlatPtr)xsdt_ptr->table_ptrs[i]); } return {}; } @@ -347,8 +347,8 @@ namespace ACPI { auto* rsdt_ptr = (volatile Structures::RSDT*)main_sdt_region->vaddr().offset(rsdt.offset_in_page().get()).as_ptr(); for (u32 i = 0; i < ((rsdt_ptr->h.length - sizeof(Structures::SDTHeader)) / sizeof(u32)); i++) { - if (match_table_signature(PhysicalAddress((uintptr_t)rsdt_ptr->table_ptrs[i]), signature)) - return PhysicalAddress((uintptr_t)rsdt_ptr->table_ptrs[i]); + if (match_table_signature(PhysicalAddress((FlatPtr)rsdt_ptr->table_ptrs[i]), signature)) + return PhysicalAddress((FlatPtr)rsdt_ptr->table_ptrs[i]); } return {}; } |