// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 /****************************************************************************** * * Module Name: tbdata - Table manager data structure functions * * Copyright (C) 2000 - 2023, Intel Corp. * *****************************************************************************/ #include <acpi/acpi.h> #include "accommon.h" #include "acnamesp.h" #include "actables.h" #include "acevents.h" #define _COMPONENT … ACPI_MODULE_NAME("tbdata") /* Local prototypes */ static acpi_status acpi_tb_check_duplication(struct acpi_table_desc *table_desc, u32 *table_index); static u8 acpi_tb_compare_tables(struct acpi_table_desc *table_desc, u32 table_index); /******************************************************************************* * * FUNCTION: acpi_tb_compare_tables * * PARAMETERS: table_desc - Table 1 descriptor to be compared * table_index - Index of table 2 to be compared * * RETURN: TRUE if both tables are identical. * * DESCRIPTION: This function compares a table with another table that has * already been installed in the root table list. * ******************************************************************************/ static u8 acpi_tb_compare_tables(struct acpi_table_desc *table_desc, u32 table_index) { … } /******************************************************************************* * * FUNCTION: acpi_tb_init_table_descriptor * * PARAMETERS: table_desc - Table descriptor * address - Physical address of the table * flags - Allocation flags of the table * table - Pointer to the table * * RETURN: None * * DESCRIPTION: Initialize a new table descriptor * ******************************************************************************/ void acpi_tb_init_table_descriptor(struct acpi_table_desc *table_desc, acpi_physical_address address, u8 flags, struct acpi_table_header *table) { … } /******************************************************************************* * * FUNCTION: acpi_tb_acquire_table * * PARAMETERS: table_desc - Table descriptor * table_ptr - Where table is returned * table_length - Where table length is returned * table_flags - Where table allocation flags are returned * * RETURN: Status * * DESCRIPTION: Acquire an ACPI table. It can be used for tables not * maintained in the acpi_gbl_root_table_list. * ******************************************************************************/ acpi_status acpi_tb_acquire_table(struct acpi_table_desc *table_desc, struct acpi_table_header **table_ptr, u32 *table_length, u8 *table_flags) { … } /******************************************************************************* * * FUNCTION: acpi_tb_release_table * * PARAMETERS: table - Pointer for the table * table_length - Length for the table * table_flags - Allocation flags for the table * * RETURN: None * * DESCRIPTION: Release a table. The inverse of acpi_tb_acquire_table(). * ******************************************************************************/ void acpi_tb_release_table(struct acpi_table_header *table, u32 table_length, u8 table_flags) { … } /******************************************************************************* * * FUNCTION: acpi_tb_acquire_temp_table * * PARAMETERS: table_desc - Table descriptor to be acquired * address - Address of the table * flags - Allocation flags of the table * table - Pointer to the table (required for virtual * origins, optional for physical) * * RETURN: Status * * DESCRIPTION: This function validates the table header to obtain the length * of a table and fills the table descriptor to make its state as * "INSTALLED". Such a table descriptor is only used for verified * installation. * ******************************************************************************/ acpi_status acpi_tb_acquire_temp_table(struct acpi_table_desc *table_desc, acpi_physical_address address, u8 flags, struct acpi_table_header *table) { … } /******************************************************************************* * * FUNCTION: acpi_tb_release_temp_table * * PARAMETERS: table_desc - Table descriptor to be released * * RETURN: Status * * DESCRIPTION: The inverse of acpi_tb_acquire_temp_table(). * *****************************************************************************/ void acpi_tb_release_temp_table(struct acpi_table_desc *table_desc) { … } /****************************************************************************** * * FUNCTION: acpi_tb_validate_table * * PARAMETERS: table_desc - Table descriptor * * RETURN: Status * * DESCRIPTION: This function is called to validate the table, the returned * table descriptor is in "VALIDATED" state. * *****************************************************************************/ acpi_status acpi_tb_validate_table(struct acpi_table_desc *table_desc) { … } /******************************************************************************* * * FUNCTION: acpi_tb_invalidate_table * * PARAMETERS: table_desc - Table descriptor * * RETURN: None * * DESCRIPTION: Invalidate one internal ACPI table, this is the inverse of * acpi_tb_validate_table(). * ******************************************************************************/ void acpi_tb_invalidate_table(struct acpi_table_desc *table_desc) { … } /****************************************************************************** * * FUNCTION: acpi_tb_validate_temp_table * * PARAMETERS: table_desc - Table descriptor * * RETURN: Status * * DESCRIPTION: This function is called to validate the table, the returned * table descriptor is in "VALIDATED" state. * *****************************************************************************/ acpi_status acpi_tb_validate_temp_table(struct acpi_table_desc *table_desc) { … } /******************************************************************************* * * FUNCTION: acpi_tb_check_duplication * * PARAMETERS: table_desc - Table descriptor * table_index - Where the table index is returned * * RETURN: Status * * DESCRIPTION: Avoid installing duplicated tables. However table override and * user aided dynamic table load is allowed, thus comparing the * address of the table is not sufficient, and checking the entire * table content is required. * ******************************************************************************/ static acpi_status acpi_tb_check_duplication(struct acpi_table_desc *table_desc, u32 *table_index) { … } /****************************************************************************** * * FUNCTION: acpi_tb_verify_temp_table * * PARAMETERS: table_desc - Table descriptor * signature - Table signature to verify * table_index - Where the table index is returned * * RETURN: Status * * DESCRIPTION: This function is called to validate and verify the table, the * returned table descriptor is in "VALIDATED" state. * Note that 'TableIndex' is required to be set to !NULL to * enable duplication check. * *****************************************************************************/ acpi_status acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc, char *signature, u32 *table_index) { … } /******************************************************************************* * * FUNCTION: acpi_tb_resize_root_table_list * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Expand the size of global table array * ******************************************************************************/ acpi_status acpi_tb_resize_root_table_list(void) { … } /******************************************************************************* * * FUNCTION: acpi_tb_get_next_table_descriptor * * PARAMETERS: table_index - Where table index is returned * table_desc - Where table descriptor is returned * * RETURN: Status and table index/descriptor. * * DESCRIPTION: Allocate a new ACPI table entry to the global table list * ******************************************************************************/ acpi_status acpi_tb_get_next_table_descriptor(u32 *table_index, struct acpi_table_desc **table_desc) { … } /******************************************************************************* * * FUNCTION: acpi_tb_terminate * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Delete all internal ACPI tables * ******************************************************************************/ void acpi_tb_terminate(void) { … } /******************************************************************************* * * FUNCTION: acpi_tb_delete_namespace_by_owner * * PARAMETERS: table_index - Table index * * RETURN: Status * * DESCRIPTION: Delete all namespace objects created when this table was loaded. * ******************************************************************************/ acpi_status acpi_tb_delete_namespace_by_owner(u32 table_index) { … } /******************************************************************************* * * FUNCTION: acpi_tb_allocate_owner_id * * PARAMETERS: table_index - Table index * * RETURN: Status * * DESCRIPTION: Allocates owner_id in table_desc * ******************************************************************************/ acpi_status acpi_tb_allocate_owner_id(u32 table_index) { … } /******************************************************************************* * * FUNCTION: acpi_tb_release_owner_id * * PARAMETERS: table_index - Table index * * RETURN: Status * * DESCRIPTION: Releases owner_id in table_desc * ******************************************************************************/ acpi_status acpi_tb_release_owner_id(u32 table_index) { … } /******************************************************************************* * * FUNCTION: acpi_tb_get_owner_id * * PARAMETERS: table_index - Table index * owner_id - Where the table owner_id is returned * * RETURN: Status * * DESCRIPTION: returns owner_id for the ACPI table * ******************************************************************************/ acpi_status acpi_tb_get_owner_id(u32 table_index, acpi_owner_id *owner_id) { … } /******************************************************************************* * * FUNCTION: acpi_tb_is_table_loaded * * PARAMETERS: table_index - Index into the root table * * RETURN: Table Loaded Flag * ******************************************************************************/ u8 acpi_tb_is_table_loaded(u32 table_index) { … } /******************************************************************************* * * FUNCTION: acpi_tb_set_table_loaded_flag * * PARAMETERS: table_index - Table index * is_loaded - TRUE if table is loaded, FALSE otherwise * * RETURN: None * * DESCRIPTION: Sets the table loaded flag to either TRUE or FALSE. * ******************************************************************************/ void acpi_tb_set_table_loaded_flag(u32 table_index, u8 is_loaded) { … } /******************************************************************************* * * FUNCTION: acpi_tb_load_table * * PARAMETERS: table_index - Table index * parent_node - Where table index is returned * * RETURN: Status * * DESCRIPTION: Load an ACPI table * ******************************************************************************/ acpi_status acpi_tb_load_table(u32 table_index, struct acpi_namespace_node *parent_node) { … } /******************************************************************************* * * FUNCTION: acpi_tb_install_and_load_table * * PARAMETERS: address - Physical address of the table * flags - Allocation flags of the table * table - Pointer to the table (required for * virtual origins, optional for * physical) * override - Whether override should be performed * table_index - Where table index is returned * * RETURN: Status * * DESCRIPTION: Install and load an ACPI table * ******************************************************************************/ acpi_status acpi_tb_install_and_load_table(acpi_physical_address address, u8 flags, struct acpi_table_header *table, u8 override, u32 *table_index) { … } ACPI_EXPORT_SYMBOL(…) /******************************************************************************* * * FUNCTION: acpi_tb_unload_table * * PARAMETERS: table_index - Table index * * RETURN: Status * * DESCRIPTION: Unload an ACPI table * ******************************************************************************/ acpi_status acpi_tb_unload_table(u32 table_index) { … } ACPI_EXPORT_SYMBOL(…) /******************************************************************************* * * FUNCTION: acpi_tb_notify_table * * PARAMETERS: event - Table event * table - Validated table pointer * * RETURN: None * * DESCRIPTION: Notify a table event to the users. * ******************************************************************************/ void acpi_tb_notify_table(u32 event, void *table) { … }