diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-11-12 10:15:32 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-11-12 14:41:29 +0100 |
| commit | 83510526b66c17ed26ac86e75eb1632ed0630138 (patch) | |
| tree | 37e3f9ce9cf7bec850c6307980df047c16e0cb34 /kernel | |
| parent | ab8de113fb03736e49d89b2cccc31f9cae355500 (diff) | |
| download | kernel-83510526b66c17ed26ac86e75eb1632ed0630138.tar.xz kernel-83510526b66c17ed26ac86e75eb1632ed0630138.zip | |
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.
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/kernel/acpi/manager.cpp | 3 | ||||
| -rw-r--r-- | kernel/kernel/acpi/manager.hpp | 1 |
2 files changed, 1 insertions, 3 deletions
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 <algorithm> #include <cstddef> -#include <cstdint> #include <ranges> #include <string_view> @@ -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<std::uintptr_t>(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<kstd::observer_ptr<::acpi::table_header const>>(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 <kstd/flat_map.hpp> #include <kstd/memory.hpp> -#include <kstd/vector.hpp> #include <string_view> |
