FADT: Difference between revisions
[unchecked revision] | [unchecked revision] |
m (s/dword/uint32_t/g) |
|||
Line 129: | Line 129: | ||
|} |
|} |
||
Address is a |
Address is a 64-bit pointer in the defined address space to the data structure. |
||
== Fields == |
== Fields == |
Revision as of 18:20, 15 February 2017
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
The FADT is pointed to by an entry in the RSDT. The signature is 'FACP'. Even if the pointer was found in another ACPI valid structure, you should anyway do the checksum to check that the table is valid.
Structure
The FADT is a complex structure and contains a lot of data. Here it is:
struct FADT
{
struct ACPISDTHeader h;
uint32_t FirmwareCtrl;
uint32_t Dsdt;
// field used in ACPI 1.0; no longer in use, for compatibility only
uint8_t Reserved;
uint8_t PreferredPowerManagementProfile;
uint16_t SCI_Interrupt;
uint32_t SMI_CommandPort;
uint8_t AcpiEnable;
uint8_t AcpiDisable;
uint8_t S4BIOS_REQ;
uint8_t PSTATE_Control;
uint32_t PM1aEventBlock;
uint32_t PM1bEventBlock;
uint32_t PM1aControlBlock;
uint32_t PM1bControlBlock;
uint32_t PM2ControlBlock;
uint32_t PMTimerBlock;
uint32_t GPE0Block;
uint32_t GPE1Block;
uint8_t PM1EventLength;
uint8_t PM1ControlLength;
uint8_t PM2ControlLength;
uint8_t PMTimerLength;
uint8_t GPE0Length;
uint8_t GPE1Length;
uint8_t GPE1Base;
uint8_t CStateControl;
uint16_t WorstC2Latency;
uint16_t WorstC3Latency;
uint16_t FlushSize;
uint16_t FlushStride;
uint8_t DutyOffset;
uint8_t DutyWidth;
uint8_t DayAlarm;
uint8_t MonthAlarm;
uint8_t Century;
// reserved in ACPI 1.0; used since ACPI 2.0+
uint16_t BootArchitectureFlags;
uint8_t Reserved2;
uint32_t Flags;
// 12 byte structure; see below for details
GenericAddressStructure ResetReg;
uint8_t ResetValue;
uint8_t Reserved3[3];
// 64bit pointers - Available on ACPI 2.0+
uint64_t X_FirmwareControl;
uint64_t X_Dsdt;
GenericAddressStructure X_PM1aEventBlock;
GenericAddressStructure X_PM1bEventBlock;
GenericAddressStructure X_PM1aControlBlock;
GenericAddressStructure X_PM1bControlBlock;
GenericAddressStructure X_PM2ControlBlock;
GenericAddressStructure X_PMTimerBlock;
GenericAddressStructure X_GPE0Block;
GenericAddressStructure X_GPE1Block;
};
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:
struct GenericAddressStructure
{
uint8_t AddressSpace;
uint8_t BitWidth;
uint8_t BitOffset;
uint8_t AccessSize;
uint64_t Address;
};
Value | Address Space |
---|---|
0 | System Memory |
1 | System I/O |
2 | PCI Configuration Space |
3 | Embedded Controller |
4 | SMBus |
5 to 0x7E | Reserved |
0x7F | Functional Fixed Hardware |
0x80 to 0xBF | Reserved |
0xC0 to 0xFF | OEM Defined |
BitWidth and BitOffset are required only when accessing a bit field, and I guess you know how to use them.
AccessSize defines how many bytes at once you can read/write.
Value | Access size |
---|---|
0 | Undefined (legacy reasons) |
1 | Byte access |
2 | 16-bit access |
3 | 32-bit access |
4 | 64-bit access |
Address is a 64-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 GAS, which is 64-bits 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 Gb.
Dsdt
A 32-bit pointer to the DSDT. This has a X_Dsdt brother too.
PreferredPowerManagementProfile
This field contains a value which should address you to a power management profile. For example if it contains 2, the computer is a laptop and you should configure power management in power saving mode.
Value | Meaning |
---|---|
0 | Unspecified |
1 | Desktop |
2 | Mobile |
3 | Workstation |
4 | Enterprise Server |
5 | SOHO Server |
6 | Aplliance PC |
7 | Performance Server |
>7 | Reserved |
SCI_Interrupt
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 < 4gb) or in X_FirmwareControl (if >= 4gb)). Then you should parse the DSDT.