From 83510526b66c17ed26ac86e75eb1632ed0630138 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 12 Nov 2026 10:15:32 +0100 Subject: libs/acpi: don't convert addresses to pointer Previously, ACPI table addresses in both the RSDT and XSDT were converted to pointers. However, this is not actually correct, since within the object model of the kernel, pointers always refer to objects by their linear address, and the addresses encoded in ACPI tables are, by necessity, physical addresses. The API should therefore be honest about the fact that the addresses returned by accessors of the RSDT and XSDT are physical addresses, not pointers to live objects. --- kernel/kernel/acpi/manager.cpp | 3 +-- kernel/kernel/acpi/manager.hpp | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'kernel') diff --git a/kernel/kernel/acpi/manager.cpp b/kernel/kernel/acpi/manager.cpp index 2ba6d558..25ef52b8 100644 --- a/kernel/kernel/acpi/manager.cpp +++ b/kernel/kernel/acpi/manager.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include @@ -55,7 +54,7 @@ namespace kernel::acpi } auto check_and_register_table = [&](auto table_address) -> void { - auto physical_table_address = kapi::memory::physical_address{reinterpret_cast(table_address)}; + auto physical_table_address = kapi::memory::physical_address{table_address}; auto mapped_table = kapi::memory::hhdm_to_linear(physical_table_address); auto table = static_cast>(mapped_table); diff --git a/kernel/kernel/acpi/manager.hpp b/kernel/kernel/acpi/manager.hpp index de344dd8..8ce5368d 100644 --- a/kernel/kernel/acpi/manager.hpp +++ b/kernel/kernel/acpi/manager.hpp @@ -5,7 +5,6 @@ #include #include -#include #include -- cgit v1.2.3