From 486425ed00acec134f8799bdde64bfd093c5fb55 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 26 Dec 2024 21:19:14 +0100 Subject: IMPL: A lot of new changes, see details. Signed-off-by: Amlal El Mahrouss --- dev/Mod/ACPI/ACPI.h | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 dev/Mod/ACPI/ACPI.h (limited to 'dev/Mod/ACPI/ACPI.h') diff --git a/dev/Mod/ACPI/ACPI.h b/dev/Mod/ACPI/ACPI.h new file mode 100644 index 00000000..d21c475e --- /dev/null +++ b/dev/Mod/ACPI/ACPI.h @@ -0,0 +1,88 @@ +/* ------------------------------------------- + + 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 + +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__ -- cgit v1.2.3