summaryrefslogtreecommitdiffhomepage
path: root/dev/modules/ACPI/ACPIFactoryInterface.hxx
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-10-03 05:32:46 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-10-03 05:32:46 +0200
commit36b8e46de0e92aff31664470bb3587a91517ab99 (patch)
tree780ce906e9273ebbee00a96230557e0b7e9ac9d9 /dev/modules/ACPI/ACPIFactoryInterface.hxx
parent3e30ee1749d19f5188560f9a5cdab922180c71ca (diff)
IMP: Fixes improvements and new APIs and implementations.
- Add more threading API calls. - Moved /dev/zka/modules/ to /dev/modules/. - Add APM API inside /dev/modules. - Add SInt{x} types inside Defines.hxx. - Fix formatting inside PRM. Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'dev/modules/ACPI/ACPIFactoryInterface.hxx')
-rw-r--r--dev/modules/ACPI/ACPIFactoryInterface.hxx60
1 files changed, 60 insertions, 0 deletions
diff --git a/dev/modules/ACPI/ACPIFactoryInterface.hxx b/dev/modules/ACPI/ACPIFactoryInterface.hxx
new file mode 100644
index 00000000..3d16d5a1
--- /dev/null
+++ b/dev/modules/ACPI/ACPIFactoryInterface.hxx
@@ -0,0 +1,60 @@
+/* -------------------------------------------
+
+ Copyright ZKA Technologies.
+
+------------------------------------------- */
+
+#ifndef __MOD_ACPI_HXX__
+#define __MOD_ACPI_HXX__
+
+#include <KernelKit/DebugOutput.hxx>
+#include <modules/ACPI/ACPI.hxx>
+#include <NewKit/ErrorOr.hxx>
+#include <NewKit/Defines.hxx>
+#include <NewKit/Ref.hxx>
+
+namespace Kernel
+{
+ class ACPIFactoryInterface;
+
+ typedef ACPIFactoryInterface PowerFactoryInterface;
+
+ 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 Kernel
+
+#endif // !__MOD_ACPI_HXX__