Advanced Configuration and Power Interface.
More...
Advanced Configuration and Power Interface.
We use version 6.6 of the ACPI specification, but it contains minor mistakes or deprecated features that we use other versions to straighten out. If the "ACPI specification" is ever sourced, without mentioning its version, assume version 6.6.
Take a look at this osdev post if you want to understand how annoying the ACPI spec is.
Checklist for ACPI support from section 1.7.2 of the ACPI specification:
- [x] Use System Address Map Interfaces (this is done by the bootloader).
- [x] Find and consume the ACPI System Description Tables (this is done in
acpi_tables_init())
- [x] Interpret ACPI machine language (AML). (this is done in
aml_init())
- [X] Enumerate and configure motherboard devices described in the ACPI Namespace. (this is done in
acpi_devices_init())
- [ ] Interface with the power management timer. <– We are here.
- [ ] Interface with the real-time clock wake alarm.
- [ ] Enter ACPI mode (on legacy hardware systems).
- [ ] Implement device power management policy.
- [ ] Implement power resource management.
- [ ] Implement processor power states in the scheduler idle handlers.
- [ ] Control processor and device performance states.
- [ ] Implement the ACPI thermal model.
- [ ] Support the ACPI Event programming model including handling SCI interrupts, managing fixed events, general- purpose events, embedded controller interrupts, and dynamic device support.
- [ ] Support acquisition and release of the Global Lock.
- [ ] Use the reset register to reset the system.
- [ ] Provide APIs to influence power management policy.
- [ ] Implement driver support for ACPI-defined devices.
- [ ] Implement APIs supporting the system indicators.
- [ ] Support all system states S1-S5.
Included below is a list of deviations from the ACPI specification that we have made. Each deviation is marked with the source of the deviation in parentheses:
- Copying an object to itself is a no-op. (Windows)
- Converting a zero-length String to a Buffer still copies the null-terminator. (ACPICA)
- See also
- Easier to read version of the ACPI Specification
-
ACPI Specification Version 6.6
-
ACPI Specification Version 6.3
-
ACPI Specification Version 4.0
-
ACPICA Reference Version 6.3
-
LAI Library
◆ RSDP_CURRENT_REVISION
| #define RSDP_CURRENT_REVISION 2 |
The expected value of the revision field in the RSDP structure.
- See also
- Section 5.2.5.3 of the ACPI specification for more details.
Definition at line 66 of file acpi.h.
◆ SDT_SIGNATURE_LENGTH
| #define SDT_SIGNATURE_LENGTH 4 |
The length of the signature field in the SDT header structure.
Definition at line 71 of file acpi.h.
◆ SDT_OEM_ID_LENGTH
| #define SDT_OEM_ID_LENGTH 6 |
The length of the OEM ID field in the SDT header structure.
Definition at line 76 of file acpi.h.
◆ SDT_OEM_TABLE_ID_LENGTH
| #define SDT_OEM_TABLE_ID_LENGTH 8 |
The length of the OEM Table ID field in the SDT header structure.
Definition at line 81 of file acpi.h.
◆ RSDP_SIGNATURE_LENGTH
| #define RSDP_SIGNATURE_LENGTH 8 |
Length of the signature field in the RSDP structure.
Definition at line 105 of file acpi.h.
◆ RSDP_V1_LENGTH
| #define RSDP_V1_LENGTH 20 |
Length of the RSDP structure for ACPI version 1.0.
Definition at line 129 of file acpi.h.
◆ acpi_is_checksum_valid()
| bool acpi_is_checksum_valid |
( |
void * |
table, |
|
|
uint64_t |
length |
|
) |
| |
Check if the sum of all bytes in a table is 0.
Used to validate the checksum of ACPI tables.
- Parameters
-
| table | Pointer to the table structure. |
- Returns
- true if the table is valid, false otherwise.
Definition at line 23 of file acpi.c.
◆ acpi_get_sysfs_root()
Retrieve the sysfs root directory for ACPI.
The acpi group and by extension its directory is lazily initialized.
- Returns
- Pointer to the ACPI sysfs root directory.
Definition at line 34 of file acpi.c.
◆ acpi_reclaim_memory()
Reclaim ACPI memory regions.
This function will free all memory regions marked as ACPI Reclaimable in the provided boot memory map.
Should be called after all ACPI initialization is complete.
- Parameters
-
| map | Pointer to the boot memory map. |
Definition at line 51 of file acpi.c.