diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-12-26 21:19:14 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-12-26 21:19:14 +0100 |
| commit | 486425ed00acec134f8799bdde64bfd093c5fb55 (patch) | |
| tree | 5104af49b56f39d0b14941d76f9d6d746cd1677b /dev/Modules/ACPI | |
| parent | c0f7f3f300d603d355fc7ec5be317afe1f0ee1b6 (diff) | |
IMPL: A lot of new changes, see details.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Modules/ACPI')
| -rw-r--r-- | dev/Modules/ACPI/ACPI.h | 88 | ||||
| -rw-r--r-- | dev/Modules/ACPI/ACPIFactoryInterface.h | 60 |
2 files changed, 0 insertions, 148 deletions
diff --git a/dev/Modules/ACPI/ACPI.h b/dev/Modules/ACPI/ACPI.h deleted file mode 100644 index d21c475e..00000000 --- a/dev/Modules/ACPI/ACPI.h +++ /dev/null @@ -1,88 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024, Theater Quality Inc, all rights reserved. - -------------------------------------------- */ - -#ifndef __ACPI__ -#define __ACPI__ - -/** - https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html -*/ - -#include <NewKit/Defines.h> - -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 ACPI_ADDRESS_SPACE_KIND : UInt8 - { - eSystemMemory = 0, - eSystemIO = 1, - ePci = 2, - eController = 3, - eSmBus = 4, - eCount = 5, - eInvalid = 0xFF, - }; - - class PACKED ACPI_ADDRESS final - { - public: - UInt8 AddressSpaceId; - UInt8 RegisterBitWidth; - UInt8 RegisterBitOffset; - UInt8 Reserved; - UIntPtr Address; - }; - - class PACKED RSDT final - { - 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/Modules/ACPI/ACPIFactoryInterface.h b/dev/Modules/ACPI/ACPIFactoryInterface.h deleted file mode 100644 index d6a71316..00000000 --- a/dev/Modules/ACPI/ACPIFactoryInterface.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024, Theater Quality Inc, 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> - -namespace Kernel -{ - class ACPIFactoryInterface; - - typedef ACPIFactoryInterface PowerFactoryInterface; - - class ACPIFactoryInterface final - { - public: - explicit ACPIFactoryInterface(voidPtr rsp_ptr); - ~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_H__ |
