|
ReactOS 0.4.17-dev-683-g0dafdc5
|
#include <uacpi/internal/tables.h>#include <uacpi/internal/utilities.h>#include <uacpi/internal/stdlib.h>#include <uacpi/internal/interpreter.h>#include <uacpi/internal/mutex.h>
Go to the source code of this file.
Classes | |
| struct | table_search_ctx |
| struct | table_ctl_request |
| struct | register_description |
Macros | |
| #define | ENSURE_TABLES_ONLINE() |
| #define | TABLE_CTL_SET_FLAGS (1 << 0) |
| #define | TABLE_CTL_CLEAR_FLAGS (1 << 1) |
| #define | TABLE_CTL_VALIDATE_SET_FLAGS (1 << 2) |
| #define | TABLE_CTL_VALIDATE_CLEAR_FLAGS (1 << 3) |
| #define | TABLE_CTL_GET (1 << 4) |
| #define | TABLE_CTL_PUT (1 << 5) |
| #define | fadt_offset(field) uacpi_offsetof(struct acpi_fadt, field) |
Enumerations | |
| enum | search_type { SEARCH_TYPE_BY_ID , SEARCH_TYPE_MATCH } |
Variables | |
| uacpi_u16 | fadt_version_sizes [] |
| static struct register_description | fadt_registers [] |
| #define ENSURE_TABLES_ONLINE | ( | ) |
| #define fadt_offset | ( | field | ) | uacpi_offsetof(struct acpi_fadt, field) |
| Enumerator | |
|---|---|
| SEARCH_TYPE_BY_ID | |
| SEARCH_TYPE_MATCH | |
Definition at line 1469 of file tables.c.
Referenced by initialize_fadt().
|
static |
Definition at line 1018 of file tables.c.
Referenced by find_table(), and uacpi_table_match().
| DYNAMIC_ARRAY_WITH_INLINE_STORAGE | ( | DYNAMIC_ARRAY_WITH_INLINE_STORAGE_IMPL( | table_array, |
| DYNAMIC_ARRAY_WITH_INLINE_STORAGE_IMPL( | struct uacpi_installed_table, | ||
| UACPI_STATIC_TABLE_ARRAY_LEN | |||
| ) |
Definition at line 1366 of file tables.c.
Referenced by initialize_fadt().
|
static |
|
static |
Definition at line 1101 of file tables.c.
Referenced by find_table_by_signature(), uacpi_table_find(), and uacpi_table_find_next_with_same_signature().
|
static |
Definition at line 1122 of file tables.c.
Referenced by uacpi_table_find_by_signature(), uacpi_table_find_by_signature_at(), and uacpi_table_find_nth_by_signature().
|
static |
Definition at line 1398 of file tables.c.
Referenced by convert_registers_to_gas(), and split_one_block().
|
static |
Definition at line 513 of file tables.c.
Referenced by table_install_physical_with_origin_unlocked().
|
static |
Definition at line 762 of file tables.c.
Referenced by table_install_physical_with_origin_unlocked(), and table_install_with_origin_unlocked().
|
static |
Definition at line 1523 of file tables.c.
Referenced by verify_and_install_table().
|
static |
Definition at line 171 of file tables.c.
Referenced by uacpi_initialize_tables(), and uacpi_setup_early_table_access().
|
static |
Definition at line 111 of file tables.c.
Referenced by initialize_from_rsdp().
|
static |
Definition at line 458 of file tables.c.
Referenced by table_ctl(), table_ref_unlocked(), and uacpi_for_each_installed_table().
Definition at line 1508 of file tables.c.
Referenced by initialize_fadt().
|
static |
Definition at line 1492 of file tables.c.
Referenced by split_event_blocks().
|
static |
Definition at line 492 of file tables.c.
Referenced by verify_and_install_table().
|
static |
Definition at line 414 of file tables.c.
Referenced by uacpi_verify_table_checksum().
|
static |
Definition at line 1205 of file tables.c.
Referenced by uacpi_table_get_by_index(), uacpi_table_load_with_cause(), uacpi_table_mark_as_loaded(), uacpi_table_ref_by_index(), and uacpi_table_unref_by_index().
|
static |
Definition at line 604 of file tables.c.
Referenced by uacpi_for_each_table(), and uacpi_table_info_get_by_index().
|
static |
Definition at line 790 of file tables.c.
Referenced by handle_table_override(), initialize_fadt(), uacpi_initialize_tables(), and uacpi_table_install_physical_with_origin().
|
static |
Definition at line 883 of file tables.c.
Referenced by handle_table_override(), and uacpi_table_install_with_origin().
|
static |
Definition at line 529 of file tables.c.
Referenced by do_search_tables(), and table_ctl().
|
static |
Definition at line 573 of file tables.c.
Referenced by table_ctl().
| uacpi_status uacpi_check_table_signature | ( | void * | table, |
| const uacpi_char * | expect | ||
| ) |
Definition at line 469 of file tables.c.
Referenced by initialize_from_rxsdt(), and table_install_physical_with_origin_unlocked().
Definition at line 351 of file tables.c.
Referenced by uacpi_setup_early_table_access(), and uacpi_state_reset().
| uacpi_status uacpi_for_each_installed_table | ( | uacpi_size | base_idx, |
| uacpi_installed_table_iteration_callback | cb, | ||
| void * | user | ||
| ) |
Definition at line 971 of file tables.c.
Referenced by find_table(), uacpi_initialize_tables(), and uacpi_table_match().
| 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_initialize_tables | ( | void | ) |
Definition at line 279 of file tables.c.
Referenced by uacpi_initialize().
Definition at line 74 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_status uacpi_setup_early_table_access | ( | void * | temporary_buffer, |
| uacpi_size | buffer_size | ||
| ) |
Set up early access to the table subsystem. What this means is:
The 'temporary_buffer' is expected to be aligned on the native pointer size boundary (4 on a 32-bit system, 8 on a 64-bit system), although any misalignment is handled gracefully and does not result in an error.
The approximate overhead per table is 56 bytes, so a buffer of 4096 bytes yields about 73 tables in terms of capacity. uACPI also has an internal static buffer for tables, "UACPI_STATIC_TABLE_ARRAY_LEN", which is configured as 16 descriptors in length by default.
This function is used to initialize the barebones mode, see UACPI_BAREBONES_MODE in config.h for more information.
Definition at line 216 of file tables.c.
Definition at line 464 of file tables.c.
Referenced by do_search_tables(), match_ssdt_or_psdt(), uacpi_check_table_signature(), and verify_and_install_table().
| 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 | idx, | ||
| 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 | ||
| ) |
| uacpi_status uacpi_table_install_physical_with_origin | ( | uacpi_phys_addr | phys, |
| enum uacpi_table_origin | origin, | ||
| uacpi_table * | out_table | ||
| ) |
Definition at line 865 of file tables.c.
Referenced by initialize_from_rxsdt(), and uacpi_table_install_physical().
| uacpi_status uacpi_table_install_with_origin | ( | void * | virt, |
| enum uacpi_table_origin | origin, | ||
| uacpi_table * | out_table | ||
| ) |
Definition at line 935 of file tables.c.
Referenced by handle_load(), and uacpi_table_install().
| 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_load_with_cause | ( | uacpi_size | idx, |
| enum uacpi_table_load_cause | cause | ||
| ) |
Definition at line 1280 of file tables.c.
Referenced by uacpi_namespace_load(), and uacpi_table_load().
| void uacpi_table_mark_as_loaded | ( | uacpi_size | idx | ) |
Definition at line 1308 of file tables.c.
Referenced by handle_load(), and handle_load_table().
| uacpi_status uacpi_table_match | ( | uacpi_size | base_idx, |
| uacpi_table_match_callback | cb, | ||
| uacpi_table * | out_table | ||
| ) |
Definition at line 1081 of file tables.c.
Referenced by uacpi_namespace_load().
| 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().
| uacpi_status uacpi_verify_table_checksum | ( | void * | table, |
| uacpi_size | size, | ||
| uacpi_u8 * | out_flags | ||
| ) |
Definition at line 426 of file tables.c.
Referenced by initialize_from_rxsdt(), table_ref_unlocked(), and verify_and_install_table().
|
static |
Definition at line 695 of file tables.c.
Referenced by table_install_physical_with_origin_unlocked(), and table_install_with_origin_unlocked().
|
static |
Definition at line 263 of file tables.c.
Referenced by uacpi_initialize_tables().
|
static |
Definition at line 1421 of file tables.c.
Referenced by convert_registers_to_gas().
| uacpi_u16 fadt_version_sizes[] |
Definition at line 1362 of file tables.c.
Referenced by fadt_ensure_correct_revision().