1 /* 2 * PROJECT: ReactOS PCI Bus Driver 3 * LICENSE: BSD - See COPYING.ARM in the top level directory 4 * FILE: include/reactos/drivers/acpi/acpi.h 5 * PURPOSE: ACPI Tables and NT Registry Data 6 * PROGRAMMERS: ReactOS Portable Systems Group 7 */ 8 9 // 10 // ACPI BIOS Registry Component Configuration Data 11 // 12 typedef struct _ACPI_E820_ENTRY 13 { 14 PHYSICAL_ADDRESS Base; 15 LARGE_INTEGER Length; 16 ULONGLONG Type; 17 } ACPI_E820_ENTRY, *PACPI_E820_ENTRY; 18 19 typedef struct _ACPI_BIOS_MULTI_NODE 20 { 21 PHYSICAL_ADDRESS RsdtAddress; 22 ULONGLONG Count; 23 ACPI_E820_ENTRY E820Entry[1]; 24 } ACPI_BIOS_MULTI_NODE, *PACPI_BIOS_MULTI_NODE; 25 26 // 27 // ACPI Signatures 28 // 29 #define RSDP_SIGNATURE 0x2052545020445352 // "RSD PTR " 30 #define FACS_SIGNATURE 0x53434146 // "FACS" 31 #define FADT_SIGNATURE 0x50434146 // "FACP" 32 #define RSDT_SIGNATURE 0x54445352 // "RSDT" 33 #define APIC_SIGNATURE 0x43495041 // "APIC" 34 #define DSDT_SIGNATURE 0x54445344 // "DSDT" 35 #define SSDT_SIGNATURE 0x54445353 // "SSDT" 36 #define PSDT_SIGNATURE 0x54445350 // "PSDT" 37 #define SBST_SIGNATURE 0x54534253 // "SBST" 38 #define DBGP_SIGNATURE 0x50474244 // "DBGP" 39 #define XSDT_SIGNATURE 'TDSX' 40 #define BOOT_SIGNATURE 'TOOB' 41 #define SRAT_SIGNATURE 'TARS' 42 #define WDRT_SIGNATURE 'TRDW' 43 #define BGRT_SIGNATURE 0x54524742 // "BGRT" 44 45 // 46 // FADT Flags 47 // 48 #define ACPI_TMR_VAL_EXT 0x100 49 50 // 51 // BGRT Flags 52 // 53 #define BGRT_STATUS_IMAGE_VALID 0x01 54 55 // 56 // BGRT Image Types 57 // 58 typedef enum _BGRT_IMAGE_TYPE 59 { 60 BgrtImageTypeBitmap, 61 BgrtImageTypeMax 62 } BGRT_IMAGE_TYPE, *PBGRT_IMAGE_TYPE; 63 64 // 65 // ACPI Generic Register Address 66 // 67 #include <pshpack1.h> 68 typedef struct _GEN_ADDR 69 { 70 UCHAR AddressSpaceID; 71 UCHAR BitWidth; 72 UCHAR BitOffset; 73 UCHAR Reserved; 74 PHYSICAL_ADDRESS Address; 75 } GEN_ADDR, *PGEN_ADDR; 76 77 // 78 // ACPI BIOS Structures (packed) 79 // 80 typedef struct _RSDP 81 { 82 ULONGLONG Signature; 83 UCHAR Checksum; 84 UCHAR OEMID[6]; 85 UCHAR Revision; 86 ULONG RsdtAddress; 87 ULONG Length; 88 PHYSICAL_ADDRESS XsdtAddress; 89 UCHAR XChecksum; 90 UCHAR Reserved[3]; 91 } RSDP; 92 typedef RSDP *PRSDP; 93 94 typedef struct _DESCRIPTION_HEADER 95 { 96 ULONG Signature; 97 ULONG Length; 98 UCHAR Revision; 99 UCHAR Checksum; 100 UCHAR OEMID[6]; 101 UCHAR OEMTableID[8]; 102 ULONG OEMRevision; 103 UCHAR CreatorID[4]; 104 ULONG CreatorRev; 105 } DESCRIPTION_HEADER; 106 typedef DESCRIPTION_HEADER *PDESCRIPTION_HEADER; 107 108 typedef struct _FACS 109 { 110 ULONG Signature; 111 ULONG Length; 112 ULONG HardwareSignature; 113 ULONG pFirmwareWakingVector; 114 ULONG GlobalLock; 115 ULONG Flags; 116 PHYSICAL_ADDRESS x_FirmwareWakingVector; 117 UCHAR version; 118 UCHAR Reserved[32]; 119 } FACS; 120 typedef FACS *PFACS; 121 122 typedef struct _FADT 123 { 124 DESCRIPTION_HEADER Header; 125 ULONG facs; 126 ULONG dsdt; 127 UCHAR int_model; 128 UCHAR pm_profile; 129 USHORT sci_int_vector; 130 ULONG smi_cmd_io_port; 131 UCHAR acpi_on_value; 132 UCHAR acpi_off_value; 133 UCHAR s4bios_req; 134 UCHAR pstate_control; 135 ULONG pm1a_evt_blk_io_port; 136 ULONG pm1b_evt_blk_io_port; 137 ULONG pm1a_ctrl_blk_io_port; 138 ULONG pm1b_ctrl_blk_io_port; 139 ULONG pm2_ctrl_blk_io_port; 140 ULONG pm_tmr_blk_io_port; 141 ULONG gp0_blk_io_port; 142 ULONG gp1_blk_io_port; 143 UCHAR pm1_evt_len; 144 UCHAR pm1_ctrl_len; 145 UCHAR pm2_ctrl_len; 146 UCHAR pm_tmr_len; 147 UCHAR gp0_blk_len; 148 UCHAR gp1_blk_len; 149 UCHAR gp1_base; 150 UCHAR cstate_control; 151 USHORT lvl2_latency; 152 USHORT lvl3_latency; 153 USHORT flush_size; 154 USHORT flush_stride; 155 UCHAR duty_offset; 156 UCHAR duty_width; 157 UCHAR day_alarm_index; 158 UCHAR month_alarm_index; 159 UCHAR century_alarm_index; 160 USHORT boot_arch; 161 UCHAR reserved3[1]; 162 ULONG flags; 163 GEN_ADDR reset_reg; 164 UCHAR reset_val; 165 UCHAR reserved4[3]; 166 PHYSICAL_ADDRESS x_firmware_ctrl; 167 PHYSICAL_ADDRESS x_dsdt; 168 GEN_ADDR x_pm1a_evt_blk; 169 GEN_ADDR x_pm1b_evt_blk; 170 GEN_ADDR x_pm1a_ctrl_blk; 171 GEN_ADDR x_pm1b_ctrl_blk; 172 GEN_ADDR x_pm2_ctrl_blk; 173 GEN_ADDR x_pm_tmr_blk; 174 GEN_ADDR x_gp0_blk; 175 GEN_ADDR x_gp1_blk; 176 } FADT; 177 typedef FADT *PFADT; 178 179 typedef struct _DSDT 180 { 181 DESCRIPTION_HEADER Header; 182 UCHAR DiffDefBlock[ANYSIZE_ARRAY]; 183 } DSDT; 184 typedef DSDT *PDSDT; 185 186 typedef struct _RSDT 187 { 188 DESCRIPTION_HEADER Header; 189 ULONG Tables[ANYSIZE_ARRAY]; 190 } RSDT; 191 typedef RSDT *PRSDT; 192 193 typedef struct _XSDT 194 { 195 DESCRIPTION_HEADER Header; 196 PHYSICAL_ADDRESS Tables[ANYSIZE_ARRAY]; 197 } XSDT; 198 typedef XSDT *PXSDT; 199 #include <poppack.h> 200 201 // 202 // Microsoft-specific (pretty much) ACPI Tables, normal MS ABI packing 203 // 204 typedef struct _DEBUG_PORT_TABLE 205 { 206 DESCRIPTION_HEADER Header; 207 UCHAR InterfaceType; 208 UCHAR Reserved[3]; 209 GEN_ADDR BaseAddress; 210 } DEBUG_PORT_TABLE, *PDEBUG_PORT_TABLE; 211 212 typedef struct _WATCHDOG_TABLE 213 { 214 DESCRIPTION_HEADER Header; 215 GEN_ADDR ControlRegister; 216 GEN_ADDR CountRegister; 217 USHORT PciDeviceId; 218 USHORT PciVendorId; 219 UCHAR PciBus; 220 UCHAR PciDevice; 221 UCHAR PciFunction; 222 UCHAR PciSegment; 223 USHORT MaxCount; 224 UCHAR Units; 225 } WATCHDOG_TABLE, *PWATCHDOG_TABLE; 226 227 typedef struct _BOOT_TABLE 228 { 229 DESCRIPTION_HEADER Header; 230 UCHAR CMOSIndex; 231 UCHAR Reserved[3]; 232 } BOOT_TABLE, *PBOOT_TABLE; 233 234 typedef struct _ACPI_SRAT 235 { 236 DESCRIPTION_HEADER Header; 237 UCHAR TableRevision; 238 ULONG Reserved[2]; 239 } ACPI_SRAT, *PACPI_SRAT; 240 241 typedef struct _BGRT_TABLE 242 { 243 DESCRIPTION_HEADER Header; 244 USHORT Version; 245 UCHAR Status; 246 UCHAR ImageType; 247 ULONGLONG LogoAddress; 248 ULONG OffsetX; 249 ULONG OffsetY; 250 } BGRT_TABLE, *PBGRT_TABLE; 251 252 /* EOF */ 253