summaryrefslogtreecommitdiffhomepage
path: root/Kernel/Modules/ACPI/ACPIFactoryInterface.hxx
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-06-24 14:33:40 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-06-24 14:34:18 +0200
commit9784f940cf71aef91ccbeb1a11651a83a3eff213 (patch)
treebf0294e5ad8161372aaa27cacbfba4eb3e81eda0 /Kernel/Modules/ACPI/ACPIFactoryInterface.hxx
parent7738550a55d6fa79447d0298c53fe6320a3135b2 (diff)
IMP: UIAccessibilty class, work in progress Core CoreGraphics (GPU/FB
SDK). REFACTOR: Moved Builtins to Modules/ Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Kernel/Modules/ACPI/ACPIFactoryInterface.hxx')
-rw-r--r--Kernel/Modules/ACPI/ACPIFactoryInterface.hxx55
1 files changed, 55 insertions, 0 deletions
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 <Modules/ACPI/ACPI.hxx>
+#include <KernelKit/DebugOutput.hpp>
+#include <NewKit/Defines.hpp>
+#include <NewKit/Ref.hpp>
+
+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<voidPtr> 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<voidPtr> 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__