aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/kernel/acpi/manager.cpp3
-rw-r--r--kernel/kernel/acpi/manager.hpp1
-rw-r--r--libs/acpi/acpi/data/rsdt.cpp6
-rw-r--r--libs/acpi/acpi/data/rsdt.hpp6
-rw-r--r--libs/acpi/acpi/data/rsdt.tests.cpp2
-rw-r--r--libs/acpi/acpi/data/xsdt.cpp6
-rw-r--r--libs/acpi/acpi/data/xsdt.hpp6
-rw-r--r--libs/acpi/acpi/data/xsdt.tests.cpp2
8 files changed, 13 insertions, 19 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>
diff --git a/libs/acpi/acpi/data/rsdt.cpp b/libs/acpi/acpi/data/rsdt.cpp
index a8626742..99090beb 100644
--- a/libs/acpi/acpi/data/rsdt.cpp
+++ b/libs/acpi/acpi/data/rsdt.cpp
@@ -1,7 +1,5 @@
#include <acpi/data/rsdt.hpp>
-#include <acpi/common/table_header.hpp>
-
#include <kstd/cstring.hpp>
#include <cstddef>
@@ -16,7 +14,7 @@ namespace acpi
std::uint32_t address;
};
- [[nodiscard]] auto rsdt_entry::address() const noexcept -> table_header *
+ [[nodiscard]] auto rsdt_entry::address() const noexcept -> std::uintptr_t
{
using type = decltype(rsdt_entry_data::address);
@@ -28,7 +26,7 @@ namespace acpi
kstd::libc::memcpy(&value, data.data(), size);
- return reinterpret_cast<table_header *>(static_cast<uintptr_t>(value));
+ return static_cast<std::uintptr_t>(value);
}
[[nodiscard]] auto rsdt_entry::length() const noexcept -> std::size_t
diff --git a/libs/acpi/acpi/data/rsdt.hpp b/libs/acpi/acpi/data/rsdt.hpp
index ca36b33d..843e6cf2 100644
--- a/libs/acpi/acpi/data/rsdt.hpp
+++ b/libs/acpi/acpi/data/rsdt.hpp
@@ -1,13 +1,13 @@
#ifndef ACPI_DATA_RSDT_HPP
#define ACPI_DATA_RSDT_HPP
-#include <acpi/common/table_header.hpp>
#include <acpi/common/table_signature.hpp>
#include <acpi/common/table_type.hpp>
#include <acpi/common/vla_table.hpp>
#include <array>
#include <cstddef>
+#include <cstdint>
namespace acpi
{
@@ -37,8 +37,8 @@ namespace acpi
//! Get the address of the ACPI table pointed to by this entry.
//!
- //! @return A pointer to the ACPI table header of the referenced table.
- [[nodiscard]] auto address() const noexcept -> table_header *;
+ //! @return The physical address of the ACPI table header of the referenced table.
+ [[nodiscard]] auto address() const noexcept -> std::uintptr_t;
//! Get the length of the ACPI table pointed to by this entry.
//!
diff --git a/libs/acpi/acpi/data/rsdt.tests.cpp b/libs/acpi/acpi/data/rsdt.tests.cpp
index c111f749..691fd631 100644
--- a/libs/acpi/acpi/data/rsdt.tests.cpp
+++ b/libs/acpi/acpi/data/rsdt.tests.cpp
@@ -41,7 +41,7 @@ SCENARIO("RSDT parsing", "[rsdt]")
THEN("the first entry has address 0x10")
{
- REQUIRE(rsdt->cbegin()->address() == reinterpret_cast<acpi::table_header *>(0x10));
+ REQUIRE(rsdt->cbegin()->address() == 0x10);
}
THEN("the length is sizeof(rsdt) + 8 * sizeof(rsdt_entry)")
diff --git a/libs/acpi/acpi/data/xsdt.cpp b/libs/acpi/acpi/data/xsdt.cpp
index c4b109b8..6f280889 100644
--- a/libs/acpi/acpi/data/xsdt.cpp
+++ b/libs/acpi/acpi/data/xsdt.cpp
@@ -1,7 +1,5 @@
#include <acpi/data/xsdt.hpp>
-#include <acpi/common/table_header.hpp>
-
#include <kstd/cstring.hpp>
#include <cstddef>
@@ -16,7 +14,7 @@ namespace acpi
std::uint64_t address;
};
- [[nodiscard]] auto xsdt_entry::address() const noexcept -> table_header *
+ [[nodiscard]] auto xsdt_entry::address() const noexcept -> std::uintptr_t
{
using type = decltype(xsdt_entry_data::address);
@@ -28,7 +26,7 @@ namespace acpi
kstd::libc::memcpy(&value, data.data(), size);
- return reinterpret_cast<table_header *>(static_cast<uintptr_t>(value));
+ return static_cast<std::uintptr_t>(value);
}
[[nodiscard]] auto xsdt_entry::length() const noexcept -> std::size_t
diff --git a/libs/acpi/acpi/data/xsdt.hpp b/libs/acpi/acpi/data/xsdt.hpp
index ef268d5f..f8c0a775 100644
--- a/libs/acpi/acpi/data/xsdt.hpp
+++ b/libs/acpi/acpi/data/xsdt.hpp
@@ -1,13 +1,13 @@
#ifndef ACPI_DATA_XSDT_HPP
#define ACPI_DATA_XSDT_HPP
-#include <acpi/common/table_header.hpp>
#include <acpi/common/table_signature.hpp>
#include <acpi/common/table_type.hpp>
#include <acpi/common/vla_table.hpp>
#include <array>
#include <cstddef>
+#include <cstdint>
namespace acpi
{
@@ -37,8 +37,8 @@ namespace acpi
//! Get the address of the ACPI table pointed to by this entry.
//!
- //! @return A pointer to the ACPI table header of the referenced table.
- [[nodiscard]] auto address() const noexcept -> table_header *;
+ //! @return The physical address of the ACPI table header of the referenced table.
+ [[nodiscard]] auto address() const noexcept -> std::uintptr_t;
//! Get the length of the ACPI table pointed to by this entry.
//!
diff --git a/libs/acpi/acpi/data/xsdt.tests.cpp b/libs/acpi/acpi/data/xsdt.tests.cpp
index e5eaed67..955c08df 100644
--- a/libs/acpi/acpi/data/xsdt.tests.cpp
+++ b/libs/acpi/acpi/data/xsdt.tests.cpp
@@ -41,7 +41,7 @@ SCENARIO("XSDT parsing", "[xsdt]")
THEN("the first entry has address 0x10")
{
- REQUIRE(xsdt->cbegin()->address() == reinterpret_cast<acpi::table_header *>(0x10));
+ REQUIRE(xsdt->cbegin()->address() == 0x10);
}
THEN("the length is sizeof(xsdt) + 8 * sizeof(xsdt_entry)")