diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-03-23 19:13:48 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-03-23 19:15:17 +0100 |
| commit | a13e1c0911c0627184bc38f18c7fdda64447b3ad (patch) | |
| tree | 073a62c09bf216e85a3f310376640fa1805147f9 /dev/modules/ACPI/ACPIFactoryInterface.h | |
| parent | 149fa096eb306d03686b3b67e813cf1a78e08cd0 (diff) | |
meta(kernel): Reworked repository's filesystem structure.
Removing useless parts of the project too.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/modules/ACPI/ACPIFactoryInterface.h')
| -rw-r--r-- | dev/modules/ACPI/ACPIFactoryInterface.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/dev/modules/ACPI/ACPIFactoryInterface.h b/dev/modules/ACPI/ACPIFactoryInterface.h new file mode 100644 index 00000000..06a5c6e9 --- /dev/null +++ b/dev/modules/ACPI/ACPIFactoryInterface.h @@ -0,0 +1,59 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef __MOD_ACPI_H__ +#define __MOD_ACPI_H__ + +#include <KernelKit/DebugOutput.h> +#include <modules/ACPI/ACPI.h> +#include <NewKit/ErrorOr.h> +#include <NewKit/Defines.h> +#include <NewKit/Ref.h> +#include <modules/Pwr/PowerFactory.h> + +namespace NeOS +{ + class PowerFactory; + class ACPIFactoryInterface; + + typedef ACPIFactoryInterface PowerFactoryInterface; + + class ACPIFactoryInterface final NE_POWER_FACTORY + { + public: + explicit ACPIFactoryInterface(voidPtr rsp_ptr); + ~ACPIFactoryInterface() = default; + + ACPIFactoryInterface& operator=(const ACPIFactoryInterface&) = default; + ACPIFactoryInterface(const ACPIFactoryInterface&) = default; + + public: + Bool 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); + + private: + VoidPtr fRsdp{nullptr}; // pointer to root descriptor. + SSizeT fEntries{0UL}; // number of entries, -1 tells that no invalid entries were + // found. + }; +} // namespace NeOS + +#endif // !__MOD_ACPI_H__ |
