FADT: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
Solar (talk | contribs)
m Bot: Replace deprecated source tag with syntaxhighlight
 
(15 intermediate revisions by 9 users not shown)
Line 1:
{{ACPI}}
'''FADT''' (Fixed ACPI Description Table) is a data structure used in the [[ACPI]] programming interface. This table contains information about fixed register blocks pertaining to power management.
''This page is about the ACPI FADT(Fixed ACPI Description Table)''
It contains information about ACPI fixed registers, DSDT pointer, etc.
 
'''FADT''' (Fixed ACPI Description Table) is a data structure used in the [[ACPI]] programming interface. This table contains information about fixed register blocks pertaining to power management.
 
==Finding the FADT==
Line 6 ⟶ 10:
==Structure==
The FADT is a complex structure and contains a lot of data. Here it is:
<sourcesyntaxhighlight lang="c">struct FADT
{
struct ACPISDTHeader h;
Line 72 ⟶ 76:
GenericAddressStructure X_GPE0Block;
GenericAddressStructure X_GPE1Block;
};</sourcesyntaxhighlight>
 
== GenericAddressStructure ==
Before going to far, keep in mind that the GAS is a structure used by ACPI to describe the position of registers. Its structure is:
<sourcesyntaxhighlight lang="c">struct GenericAddressStructure
{
uint8_t AddressSpace;
Line 83 ⟶ 87:
uint8_t AccessSize;
uint64_t Address;
};</sourcesyntaxhighlight>
{| border="1"
|+ Possible values of AddressSpace
Line 94 ⟶ 98:
| 1 || System I/O
|-
| 2 || [[PCI]] Configuration Space
|-
| 3 || Embedded Controller
|-
| 4 || [[SMBus|System Management Bus]]
|-
| 5 to 0x7E || ReservedSystem [[CMOS]]
|-
| 6 || PCI Device [https://wiki.osdev.org/PCI#PCI_Device_Structure BAR] Target
| 0x7F || Functional Fixed Hardware
|-
| 7 || [[IPMI|Intelligent Platform Management Infrastructure]]
| 0x80 to 0xBF || Reserved
|-
| 8 || [[General Purpose I/O]]
| 0xC0 to 0xFF || OEM Defined
|-
| 9 || [[Generic Serial Bus]]
|-
| 0x0A || [[PCC|Platform Communication Channel]]
|-
| 0x800x0B to 0xBF0x7F || Reserved
|-
| 0xC00x80 to 0xFF || OEM Defined
|}
 
Line 122 ⟶ 134:
| 1 || Byte access
|-
| 2 || 16-bit Word(word) access
|-
| 3 || 32-bit Doubleword(dword) access
|-
| 4 || 64-bit Quadword(qword) access
|}
 
Address is a 64bit64-bit pointer in the defined address space to the data structure.
 
== Fields ==
=== FirmwareCtrl ===
This is a 32-bit pointer to the [[FACS]]. Since ACPI 2.0 a new field has been added to the table, X_FirmwareControl of type [[#GenericAddressStructure|GAS]], which is 64-bitbits wide. Only one of the two fields is used, the other contains 0. According to the Specs, the X_ field is used only when the FACS is placed above the 4th GbGB.
 
=== Dsdt ===
A 32-bit pointer to the [[DSDT]]. This has a X_Dsdt brother too.
Line 163 ⟶ 176:
|}
=== SCI_Interrupt ===
The System Control Interrupt is used by ACPI to notify the OS about fixed events, such as for example, pressing the power button, or for General Purpose Events (GPEs), which are firmware specific. This member in the FADT structure indicates the [[PIC]] or [[IOAPIC]] interrupt pin for it. To know if it's a PIC IRQ, check if the dual 8259 interrupt controllers are present via the [[MADT]]. Otherwise, it's a GSI. If you are using the IOAPIC and the PIC is present, remember to check the Interrupt Source Overrides first to get the GSI associated with the IRQ source.
The SCI IRQ number when working using the [[8259 PIC]]. The System Control Interrupt is used from the ACPI hardware to notify the OS of particular events, such as the user pressing of the power button.
 
=== SMI_CommandPort ===
This is an I/O Port. This is where the OS writes AcpiEnable or AcpiDisable to get or release the ownership over the ACPI registers. This is 0 on systems where the [[System Management Mode]] is not supported.
== What's next? ==
You should preserve the pointer to the [[FACS]] (in FirmwareControl (if < 4gb4GB) or in X_FirmwareControl (if >= 4gb4GB)). Then you should parse the [[DSDT]].
 
[[Category:ACPI]]