ACPI: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
m (Added section "Forum Links")
Line 19: Line 19:
On some PCs, this is already done for you if....
On some PCs, this is already done for you if....


* the smi command field in the FADT is 0
* the SMI command field in the FADT is 0
* the ACPI enable and ACPI disable fields in the FADT are both 0
* the ACPI enable and ACPI disable fields in the FADT are both 0
* bit 0 (value 1) of the PM1a control block I/O port is set


Otherwise, write the value of the ACPI Enable field into the register number pointed to by the smi command field, like so:
Otherwise, write the value of the ACPI Enable field into the register number pointed to by the smi command field, like so:


<source lang="c">
outb(fadt->smi_command,fadt->acpi_enable);
outb(fadt->smi_command,fadt->acpi_enable);

</source>
Linux waits 3 seconds for the hardware to change modes.
Linux waits 3 seconds for the hardware to change modes.
Then poll the PM1a control block until bit 0 (value 1) sets. When this bit is set, it means power management events are generating SCIs and not SMIs, which means your OS has to handle the events and the System Management BIOS isn't doing anything for you. The SCI is an IRQ that the FADT tells you about.
<source lang="c">
while(inw(fadt->pm1a_control_block) & 1 == 0);
</source>


== See Also ==
== See Also ==