diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-18 21:39:29 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-18 21:39:29 +0200 |
| commit | da70596895d8135e08f8caac6978117697b4c021 (patch) | |
| tree | 2516785b5434df8453687f05dc8dd877438901ab /dev/Kernel/Modules/ACPI | |
| parent | 005de79004c9d30e64bdee6e14e06f9d47d1f2ab (diff) | |
[REFACTOR]
Improved project structure.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/Modules/ACPI')
| -rw-r--r-- | dev/Kernel/Modules/ACPI/.gitkeep | 0 | ||||
| -rw-r--r-- | dev/Kernel/Modules/ACPI/ACPI.hxx | 88 | ||||
| -rw-r--r-- | dev/Kernel/Modules/ACPI/ACPIFactoryInterface.hxx | 60 | ||||
| -rw-r--r-- | dev/Kernel/Modules/ACPI/compile_flags.txt | 4 |
4 files changed, 0 insertions, 152 deletions
diff --git a/dev/Kernel/Modules/ACPI/.gitkeep b/dev/Kernel/Modules/ACPI/.gitkeep deleted file mode 100644 index e69de29b..00000000 --- a/dev/Kernel/Modules/ACPI/.gitkeep +++ /dev/null diff --git a/dev/Kernel/Modules/ACPI/ACPI.hxx b/dev/Kernel/Modules/ACPI/ACPI.hxx deleted file mode 100644 index 7ea34bd0..00000000 --- a/dev/Kernel/Modules/ACPI/ACPI.hxx +++ /dev/null @@ -1,88 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Technologies. - -------------------------------------------- */ - -#ifndef __ACPI__ -#define __ACPI__ - -/** - https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html -*/ - -#include <NewKit/Defines.hxx> - -namespace Kernel -{ - class PACKED SDT - { - public: - Char Signature[4]; - UInt32 Length; - UInt8 Revision; - Char Checksum; - Char OemId[6]; - Char OemTableId[8]; - UInt32 OemRev; - UInt32 CreatorID; - UInt32 CreatorRevision; - }; - - class PACKED RSDP : public SDT - { - public: - UInt32 RsdtAddress; - UIntPtr XsdtAddress; - UInt8 ExtendedChecksum; - UInt8 Reserved0[3]; - }; - - class PACKED ConfigHeader - { - public: - UInt64 BaseAddress; - UInt16 PciSegGroup; - UInt8 StartBus; - UInt8 EndBus; - UInt32 Reserved; - }; - - enum class AddressSpace : UInt8 - { - SystemMemory = 0, - SystemIO = 1, - Pci = 2, - Controller = 3, - SmBus = 4, - Count = 5, - Invalid = 0xFF, - }; - - class PACKED Address - { - public: - AddressSpace AddressSpaceId; - UInt8 RegisterBitWidth; - UInt8 RegisterBitOffset; - UInt8 Reserved; - UIntPtr Address; - }; - - class PACKED RSDT - { - public: - Char Signature[4]; - UInt32 Length; - UInt8 Revision; - Char Checksum; - Char OemId[6]; - Char OemTableId[8]; - UInt32 OemRev; - UInt32 CreatorID; - UInt32 CreatorRevision; - UInt32 AddressArr[]; - }; -} // namespace Kernel - -#endif // !__ACPI__ diff --git a/dev/Kernel/Modules/ACPI/ACPIFactoryInterface.hxx b/dev/Kernel/Modules/ACPI/ACPIFactoryInterface.hxx deleted file mode 100644 index 6405dc1b..00000000 --- a/dev/Kernel/Modules/ACPI/ACPIFactoryInterface.hxx +++ /dev/null @@ -1,60 +0,0 @@ -/* ------------------------------------------- - - 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__ diff --git a/dev/Kernel/Modules/ACPI/compile_flags.txt b/dev/Kernel/Modules/ACPI/compile_flags.txt deleted file mode 100644 index 1bc51142..00000000 --- a/dev/Kernel/Modules/ACPI/compile_flags.txt +++ /dev/null @@ -1,4 +0,0 @@ --I./ --I../ --I../../ --std=c++20 |
