aboutsummaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-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
6 files changed, 12 insertions, 16 deletions
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)")