:github_url: https://github.com/nyx-org/gaia .. _program_listing_file_dev_acpi_acpi.hpp: Program Listing for File acpi.hpp ================================= |exhale_lsh| :ref:`Return to documentation for file ` (``dev/acpi/acpi.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace Gaia::Dev { struct AcpiTable { struct [[gnu::packed]] { char signature[4]; uint32_t length; uint8_t revision; uint8_t checksum; char oem_id[6]; uint8_t oem_table_id[8]; uint32_t oem_revision; char creator_id[4]; uint32_t creator_revision; } header; }; struct [[gnu::packed]] Rsdt : AcpiTable { uint32_t entry[]; }; struct [[gnu::packed]] Xsdt : AcpiTable { uint64_t entry[]; }; struct [[gnu::packed]] Rsdp { char signature[8]; uint8_t checksum; char oem_id[6]; uint8_t revision; uint32_t rsdt; uint32_t length; uint64_t xsdt; uint8_t ex_checksum; uint8_t reserved[3]; }; class AcpiPc : public Service { public: explicit AcpiPc(Charon charon); const char *class_name() override { return "AcpiPc"; } const char *name() override { return "AcpiPc0"; } void dump_tables(); void load_drivers(); frg::optional find_table(frg::string_view signature); Charon &get_charon() { return charon; } private: template void iterate(lai_nsnode_t *obj, F func); Rsdp *rsdp; AcpiTable *sdt; bool xsdt; Charon charon; }; } // namespace Gaia::Dev