|
ReactOS 0.4.17-dev-684-ga6524ef
|


Go to the source code of this file.
Classes | |
| struct | uacpi_table_identifiers |
| struct | uacpi_table |
| struct | uacpi_table_info |
Macros | |
| #define | UACPI_TABLE_LOADED (1 << 0) |
| #define | UACPI_TABLE_CSUM_CHECKED (1 << 1) |
| #define | UACPI_TABLE_CSUM_BAD (1 << 2) |
Typedefs | |
| typedef struct uacpi_table_identifiers | uacpi_table_identifiers |
| typedef struct uacpi_table | uacpi_table |
| typedef enum uacpi_table_installation_disposition | uacpi_table_installation_disposition |
| typedef uacpi_table_installation_disposition(* | uacpi_table_installation_handler) (struct acpi_sdt_hdr *hdr, uacpi_u64 *out_override_address) |
| typedef enum uacpi_table_origin | uacpi_table_origin |
| typedef struct uacpi_table_info | uacpi_table_info |
| typedef uacpi_iteration_decision(* | uacpi_table_iteration_callback) (uacpi_handle, uacpi_table_info *info) |
| typedef uacpi_iteration_decision(* | uacpi_subtable_iteration_callback) (uacpi_handle, struct acpi_entry_hdr *) |
| #define UACPI_TABLE_CSUM_BAD (1 << 2) |
| #define UACPI_TABLE_CSUM_CHECKED (1 << 1) |
| #define UACPI_TABLE_LOADED (1 << 0) |
| typedef uacpi_iteration_decision(* uacpi_subtable_iteration_callback) (uacpi_handle, struct acpi_entry_hdr *) |
| typedef struct uacpi_table uacpi_table |
| typedef struct uacpi_table_info uacpi_table_info |
| typedef uacpi_table_installation_disposition(* uacpi_table_installation_handler) (struct acpi_sdt_hdr *hdr, uacpi_u64 *out_override_address) |
| typedef uacpi_iteration_decision(* uacpi_table_iteration_callback) (uacpi_handle, uacpi_table_info *info) |
| typedef enum uacpi_table_origin uacpi_table_origin |
| Enumerator | |
|---|---|
| UACPI_TABLE_INSTALLATION_DISPOSITON_ALLOW | |
| UACPI_TABLE_INSTALLATION_DISPOSITON_DENY | Deny the table from being installed completely. This is useful for debugging various problems, e.g. AML loading bad SSDTs that cause the system to hang or enter an undesired state. |
| UACPI_TABLE_INSTALLATION_DISPOSITON_VIRTUAL_OVERRIDE | Override the table being installed with the table at the virtual address returned in 'out_override_address'. |
| UACPI_TABLE_INSTALLATION_DISPOSITON_PHYSICAL_OVERRIDE | Override the table being installed with the table at the physical address returned in 'out_override_address'. |
Definition at line 139 of file tables.h.
| Enumerator | |
|---|---|
| UACPI_TABLE_ORIGIN_FIRMWARE_PHYSICAL | A table that originated from a physical address provided by the firmware. All tables discovered via RSDP have this origin. |
| UACPI_TABLE_ORIGIN_FIRMWARE_VIRTUAL | A table that was dynamically loaded by the AML firmware. This includes both Load/LoadTable opcodes. Such tables live in a heap-allocated kernel buffer. |
| UACPI_TABLE_ORIGIN_HOST_PHYSICAL | A table installed by the client code via uacpi_table_install_physical(). |
| UACPI_TABLE_ORIGIN_HOST_VIRTUAL | A table installed by the client code via uacpi_table_install(). |
Definition at line 176 of file tables.h.
| uacpi_status uacpi_for_each_subtable | ( | struct acpi_sdt_hdr * | hdr, |
| size_t | hdr_size, | ||
| uacpi_subtable_iteration_callback | cb, | ||
| void * | user | ||
| ) |
Iterate every subtable of a table such as MADT or SRAT.
'hdr' is the pointer to the main table, 'hdr_size' is the number of bytes in the table before the beginning of the subtable records. 'cb' is the callback invoked for each subtable with the 'user' context pointer passed for every invocation.
Example usage: uacpi_table tbl;
uacpi_table_find_by_signature(ACPI_MADT_SIGNATURE, &tbl); uacpi_for_each_subtable( tbl.hdr, sizeof(struct acpi_madt), parse_madt, NULL );
Definition at line 1600 of file tables.c.
| uacpi_status uacpi_for_each_table | ( | uacpi_table_iteration_callback | cb, |
| void * | user | ||
| ) |
Iterate every installed table on the system.
The provided callback receives the information about each table in the 'info' pointer. A table may be mapped by client code if needed via uacpi_table_get_by_index().
Note that this is a low level helper that iterates every installed table, even tables that are unreachable via uacpi_table_find() etc. due to bad checksum.
Definition at line 658 of file tables.c.
| uacpi_status uacpi_set_table_installation_handler | ( | uacpi_table_installation_handler | handler | ) |
Set a handler that is invoked for each table before it gets installed.
Depending on the return value, the table is either allowed to be installed as-is, denied, or overriden with a new one.
Definition at line 392 of file tables.c.
| uacpi_size uacpi_table_count | ( | void | ) |
| uacpi_status uacpi_table_fadt | ( | struct acpi_fadt ** | out_fadt | ) |
Returns the pointer to a sanitized internal version of FADT.
The revision is guaranteed to be correct. All of the registers are converted to GAS format. Fields that might contain garbage are cleared.
Definition at line 1589 of file tables.c.
| uacpi_status uacpi_table_find | ( | const uacpi_table_identifiers * | id, |
| uacpi_table * | out_table | ||
| ) |
Definition at line 1178 of file tables.c.
Referenced by handle_create_data_region(), and handle_load_table().
| uacpi_status uacpi_table_find_by_signature | ( | const uacpi_char * | signature, |
| uacpi_table * | out_table | ||
| ) |
Helpers for finding tables.
for find_by_signature: 'signature' is an array of 4 characters, a null terminator is not necessary and can be omitted (especially useful for non-C language bindings)
for find_by_signature_at: 'offset' specifies the base index in the internal array where to start searching for the table
for find_nth_by_signature: This works exactly like find_by_signature, but finds the nth copy of the specified table in the firmware enumeration order
'out_table' is a pointer to a caller allocated uacpi_table structure that receives the table pointer & its internal index in case the call was successful.
NOTE: The returned table's reference count is incremented by 1, which keeps its mapping alive forever unless uacpi_table_unref() is called for this table later on. Calling uacpi_table_find_next_with_same_signature() on a table also drops its reference count by 1, so if you want to keep it mapped you must manually call uacpi_table_ref() beforehand.
Definition at line 1153 of file tables.c.
Referenced by uacpi_namespace_load().
| uacpi_status uacpi_table_find_by_signature_at | ( | const uacpi_char * | signature, |
| uacpi_size | offset, | ||
| uacpi_table * | out_table | ||
| ) |
| uacpi_status uacpi_table_find_next_with_same_signature | ( | uacpi_table * | in_out_table | ) |
Definition at line 1160 of file tables.c.
| uacpi_status uacpi_table_find_nth_by_signature | ( | const uacpi_char * | signature, |
| uacpi_size | nth, | ||
| uacpi_table * | out_table | ||
| ) |
| uacpi_status uacpi_table_get_by_index | ( | uacpi_size | idx, |
| uacpi_table * | out_table | ||
| ) |
Returns a table by its index in the internal table array.
The number of available tables can be queried via 'uacpi_table_count()'.
NOTE: Even if a table is present, this may still fail with UACPI_STATUS_BAD_CHECKSUM in case UACPI_FLAG_BAD_CSUM_FATAL is enabled.
Definition at line 1318 of file tables.c.
| uacpi_status uacpi_table_info_get_by_index | ( | uacpi_size | idx, |
| uacpi_table_info * | out_info | ||
| ) |
Definition at line 630 of file tables.c.
| uacpi_status uacpi_table_install | ( | void * | virt, |
| uacpi_table * | out_table | ||
| ) |
Install a table from either a virtual or a physical address. The table is simply stored in the internal table array, and not loaded by the interpreter (see uacpi_table_load).
The table is optionally returned via 'out_table'.
Manual calls to uacpi_table_install are not subject to filtering via the table installation callback (if any).
Definition at line 951 of file tables.c.
| uacpi_status uacpi_table_install_physical | ( | uacpi_phys_addr | addr, |
| uacpi_table * | out_table | ||
| ) |
Definition at line 960 of file tables.c.
| uacpi_status uacpi_table_load | ( | uacpi_size | index | ) |
Load a previously installed table by feeding it to the interpreter.
Definition at line 1303 of file tables.c.
| uacpi_status uacpi_table_ref | ( | uacpi_table * | tbl | ) |
Increment/decrement a table's reference count. The table is unmapped when the reference count drops to 0.
| uacpi_status uacpi_table_ref_by_index | ( | uacpi_size | index | ) |
| uacpi_status uacpi_table_unref | ( | uacpi_table * | tbl | ) |
Definition at line 1357 of file tables.c.
Referenced by free_op_region(), handle_load(), handle_load_table(), uacpi_namespace_load(), and uacpi_table_find_next_with_same_signature().
| uacpi_status uacpi_table_unref_by_index | ( | uacpi_size | index | ) |
Definition at line 1348 of file tables.c.
Referenced by uacpi_table_unref().