X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/ae23ad2227bd97df4b464937b1dd54a0f3702148..839da03f6ebe838d780e52190318d4c3048990f1:/lunaix-os/includes/hal/acpi/acpi.h diff --git a/lunaix-os/includes/hal/acpi/acpi.h b/lunaix-os/includes/hal/acpi/acpi.h index 453e9f4..2e788d2 100644 --- a/lunaix-os/includes/hal/acpi/acpi.h +++ b/lunaix-os/includes/hal/acpi/acpi.h @@ -1,24 +1,29 @@ #ifndef __LUNAIX_ACPI_ACPI_H #define __LUNAIX_ACPI_ACPI_H -#include -#include #include +#include +#include -#include "sdt.h" -#include "madt.h" #include "fadt.h" +#include "madt.h" +#include "mcfg.h" +#include "sdt.h" // * for quick conversion from a table name into ACPI favoured signature // * use `echo | xxd -eg4` -#define ACPI_RSDP_SIG_L 0x20445352 // 'RSD ' -#define ACPI_RSDP_SIG_H 0x20525450 // 'PTR ' +#define ACPI_RSDP_SIG_L 0x20445352 // 'RSD ' +#define ACPI_RSDP_SIG_H 0x20525450 // 'PTR ' + +#define ACPI_MADT_SIG 0x43495041 // 'APIC' +#define ACPI_FADT_SIG 0x50434146 // 'FACP' Notice that it is not 'FADT'. -#define ACPI_MADT_SIG 0x43495041 // 'APIC' -#define ACPI_FADT_SIG 0x50434146 // 'FACP' Notice that it is not 'FADT'. +// 'MCFG' (Not part of ACPI standard. See PCI Firmware Spec.) +#define ACPI_MCFG_SIG 0x4746434d -typedef struct { +typedef struct +{ uint32_t signature_l; uint32_t signature_h; uint8_t chksum; @@ -29,12 +34,12 @@ typedef struct { uint32_t length; acpi_sdthdr_t* xsdt; uint8_t x_chksum; - char reserved[3]; // Reserved field + char reserved[3]; // Reserved field } __attribute__((packed)) acpi_rsdp_t; /** * @brief Main TOC of ACPI tables, provide hassle-free access of ACPI info. - * + * */ typedef struct { @@ -42,6 +47,7 @@ typedef struct char oem_id[7]; acpi_madt_toc_t madt; acpi_fadt_t fadt; + struct acpi_mcfg_toc mcfg; } acpi_context; int