From 9784f940cf71aef91ccbeb1a11651a83a3eff213 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 24 Jun 2024 14:33:40 +0200 Subject: IMP: UIAccessibilty class, work in progress Core CoreGraphics (GPU/FB SDK). REFACTOR: Moved Builtins to Modules/ Signed-off-by: Amlal El Mahrouss --- Kernel/Modules/ACPI/ACPIFactoryInterface.hxx | 55 ++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Kernel/Modules/ACPI/ACPIFactoryInterface.hxx (limited to 'Kernel/Modules/ACPI/ACPIFactoryInterface.hxx') diff --git a/Kernel/Modules/ACPI/ACPIFactoryInterface.hxx b/Kernel/Modules/ACPI/ACPIFactoryInterface.hxx new file mode 100644 index 00000000..7fbe6192 --- /dev/null +++ b/Kernel/Modules/ACPI/ACPIFactoryInterface.hxx @@ -0,0 +1,55 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + +------------------------------------------- */ + +#ifndef __ACPI_MANAGER__ +#define __ACPI_MANAGER__ + +#include +#include +#include +#include + +namespace NewOS +{ + class ACPIFactoryInterface final + { + public: + explicit ACPIFactoryInterface(voidPtr rsdPtr); + ~ACPIFactoryInterface() = default; + + ACPIFactoryInterface& operator=(const ACPIFactoryInterface&) = default; + ACPIFactoryInterface(const ACPIFactoryInterface&) = default; + + public: + void Shutdown(); // shutdown + void Reboot(); // soft-reboot + + public: + /// @brief Descriptor find factory. + /// @param signature The signature of the descriptor table (MADT, ACPI...) + /// @return the blob inside an ErrorOr object. + ErrorOr Find(const char* signature); + + /// @brief Checksum factory. + /// @param checksum the data to checksum + /// @param len it's size + /// @return if it succeed + bool Checksum(const char* checksum, SSizeT len); // watch for collides! + + public: + ErrorOr operator[](const char* signature) + { + return this->Find(signature); + } + + private: + VoidPtr fRsdp; // pointer to root descriptor. + SSizeT fEntries; // number of entries, -1 tells that no invalid entries were + // found. + }; +} // namespace NewOS + +#endif // !__ACPI_MANAGER__ -- cgit v1.2.3