|
PatchworkOS
|
Advanced Configuration and Power Interface. More...
Modules | |
| AML | |
| ACPI AML. | |
| Devices | |
| Device and Power Management. | |
| Tables | |
| System Description Tables. | |
Data Structures | |
| struct | sdt_header_t |
| System Description Table Header. More... | |
| struct | rsdp_t |
| Root System Description Pointer. More... | |
| struct | xsdt_t |
| Extended System Description Table. More... | |
Macros | |
| #define | RSDP_CURRENT_REVISION 2 |
| The expected value of the revision field in the RSDP structure. | |
| #define | SDT_SIGNATURE_LENGTH 4 |
| The length of the signature field in the SDT header structure. | |
| #define | SDT_OEM_ID_LENGTH 6 |
| The length of the OEM ID field in the SDT header structure. | |
| #define | SDT_OEM_TABLE_ID_LENGTH 8 |
| The length of the OEM Table ID field in the SDT header structure. | |
| #define | RSDP_SIGNATURE_LENGTH 8 |
| Length of the signature field in the RSDP structure. | |
| #define | RSDP_V1_LENGTH 20 |
| Length of the RSDP structure for ACPI version 1.0. | |
Functions | |
| bool | acpi_is_checksum_valid (void *table, uint64_t length) |
| Check if the sum of all bytes in a table is 0. | |
| dentry_t * | acpi_get_sysfs_root (void) |
| Retrieve the sysfs root directory for ACPI. | |
| void | acpi_reclaim_memory (const boot_memory_map_t *map) |
| Reclaim ACPI memory regions. | |
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:
acpi_tables_init())aml_init())acpi_devices_init())Included below is a list of deviations from the ACPI specification that we have made. Each deviation is marked with the source of the diversion:
| #define RSDP_CURRENT_REVISION 2 |
| #define RSDP_SIGNATURE_LENGTH 8 |
| #define RSDP_V1_LENGTH 20 |
| #define SDT_OEM_ID_LENGTH 6 |
| #define SDT_OEM_TABLE_ID_LENGTH 8 |
| #define SDT_SIGNATURE_LENGTH 4 |
| dentry_t * acpi_get_sysfs_root | ( | void | ) |
Retrieve the sysfs root directory for ACPI.
The acpi group and by extension its directory is lazily initialized.
Definition at line 28 of file acpi.c.
References mount, mountInitialzed, NULL, panic(), REF, mount_t::root, and sysfs_mount_new().
Referenced by acpi_tables_expose().
Check if the sum of all bytes in a table is 0.
Used to validate the checksum of ACPI tables.
| table | Pointer to the table structure. |
Definition at line 17 of file acpi.c.
Referenced by acpi_is_rsdp_valid(), and acpi_is_table_valid().
| void acpi_reclaim_memory | ( | const boot_memory_map_t * | map | ) |
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.
| map | Pointer to the boot memory map. |
Definition at line 44 of file acpi.c.
References BOOT_MEMORY_MAP_GET_DESCRIPTOR, boot_memory_map_t::length, LOG_INFO, map, PAGE_SIZE, PML_LOWER_TO_HIGHER, and pmm_free_region().
Referenced by init_finalize().