/* Local prototypes */
static acpi_status
-acpi_tb_acquire_temporal_table(struct acpi_table_desc *table_desc,
- acpi_physical_address address, u8 flags);
+acpi_tb_acquire_temp_table(struct acpi_table_desc *table_desc,
+ acpi_physical_address address, u8 flags);
-static void acpi_tb_release_temporal_table(struct acpi_table_desc *table_desc);
+static void acpi_tb_release_temp_table(struct acpi_table_desc *table_desc);
-static acpi_status acpi_tb_acquire_root_table_entry(u32 *table_index);
+static acpi_status acpi_tb_get_root_table_entry(u32 *table_index);
static u8
acpi_tb_is_equivalent_table(struct acpi_table_desc *table_desc,
*
* RETURN: Status
*
- * DESCRIPTION: Acquire a table. It can be used for tables not maintained in
- * acpi_gbl_root_table_list.
+ * DESCRIPTION: Acquire an ACPI table. It can be used for tables not
+ * maintained in the acpi_gbl_root_table_list.
*
******************************************************************************/
struct acpi_table_header *table = NULL;
switch (table_desc->flags & ACPI_TABLE_ORIGIN_MASK) {
- case ACPI_TABLE_ORIGIN_INTERN_PHYSICAL:
+ case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL:
table =
acpi_os_map_memory(table_desc->address, table_desc->length);
break;
- case ACPI_TABLE_ORIGIN_INTERN_VIRTUAL:
- case ACPI_TABLE_ORIGIN_EXTERN_VIRTUAL:
+ case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
+ case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
table =
ACPI_CAST_PTR(struct acpi_table_header,
*table_ptr = table;
*table_length = table_desc->length;
*table_flags = table_desc->flags;
-
return (AE_OK);
}
*
* RETURN: None
*
- * DESCRIPTION: Release a table. The reversal of acpi_tb_acquire_table().
+ * DESCRIPTION: Release a table. The inverse of acpi_tb_acquire_table().
*
******************************************************************************/
acpi_tb_release_table(struct acpi_table_header *table,
u32 table_length, u8 table_flags)
{
+
switch (table_flags & ACPI_TABLE_ORIGIN_MASK) {
- case ACPI_TABLE_ORIGIN_INTERN_PHYSICAL:
+ case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL:
acpi_os_unmap_memory(table, table_length);
break;
- case ACPI_TABLE_ORIGIN_INTERN_VIRTUAL:
- case ACPI_TABLE_ORIGIN_EXTERN_VIRTUAL:
+ case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
+ case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
default:
break;
*
* RETURN: None
*
- * DESCRIPTION: Invalidate one internal ACPI table, this is reversal of
+ * DESCRIPTION: Invalidate one internal ACPI table, this is the inverse of
* acpi_tb_validate_table().
*
******************************************************************************/
/*******************************************************************************
*
- * FUNCTION: acpi_tb_install_table
+ * FUNCTION: acpi_tb_init_table_descriptor
*
* PARAMETERS: table_desc - Table descriptor
* address - Physical address of the table
*
* RETURN: None
*
- * DESCRIPTION: Install an ACPI table into the global data structure.
+ * DESCRIPTION: Initialize a new table descriptor
*
******************************************************************************/
void
-acpi_tb_install_table(struct acpi_table_desc *table_desc,
- acpi_physical_address address,
- u8 flags, struct acpi_table_header *table)
+acpi_tb_init_table_descriptor(struct acpi_table_desc *table_desc,
+ acpi_physical_address address,
+ u8 flags, struct acpi_table_header *table)
{
+
/*
- * Initialize the table entry. Set the pointer to NULL, since the
+ * Initialize the table descriptor. Set the pointer to NULL, since the
* table is not fully mapped at this time.
*/
ACPI_MEMSET(table_desc, 0, sizeof(struct acpi_table_desc));
/*******************************************************************************
*
- * FUNCTION: acpi_tb_acquire_temporal_table
+ * FUNCTION: acpi_tb_acquire_temp_table
*
* PARAMETERS: table_desc - Table descriptor to be acquired
* address - Address of the table
*
* 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 table descriptor is only used for verified
+ * "INSTALLED". Such a table descriptor is only used for verified
* installation.
*
******************************************************************************/
static acpi_status
-acpi_tb_acquire_temporal_table(struct acpi_table_desc *table_desc,
- acpi_physical_address address, u8 flags)
+acpi_tb_acquire_temp_table(struct acpi_table_desc *table_desc,
+ acpi_physical_address address, u8 flags)
{
struct acpi_table_header *table_header;
switch (flags & ACPI_TABLE_ORIGIN_MASK) {
- case ACPI_TABLE_ORIGIN_INTERN_PHYSICAL:
+ case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL:
- /* Try to obtain the length of the table */
+ /* Get the length of the full table from the header */
table_header =
acpi_os_map_memory(address,
if (!table_header) {
return (AE_NO_MEMORY);
}
- acpi_tb_install_table(table_desc, address, flags, table_header);
+
+ acpi_tb_init_table_descriptor(table_desc, address, flags,
+ table_header);
acpi_os_unmap_memory(table_header,
sizeof(struct acpi_table_header));
return (AE_OK);
- case ACPI_TABLE_ORIGIN_INTERN_VIRTUAL:
- case ACPI_TABLE_ORIGIN_EXTERN_VIRTUAL:
+ case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
+ case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
table_header = ACPI_CAST_PTR(struct acpi_table_header, address);
if (!table_header) {
return (AE_NO_MEMORY);
}
- acpi_tb_install_table(table_desc, address, flags, table_header);
+
+ acpi_tb_init_table_descriptor(table_desc, address, flags,
+ table_header);
return (AE_OK);
default:
/*******************************************************************************
*
- * FUNCTION: acpi_tb_release_temporal_table
+ * FUNCTION: acpi_tb_release_temp_table
*
* PARAMETERS: table_desc - Table descriptor to be released
*
* RETURN: Status
*
- * DESCRIPTION: The reversal of acpi_tb_acquire_temporal_table().
+ * DESCRIPTION: The inverse of acpi_tb_acquire_temp_table().
*
******************************************************************************/
-static void acpi_tb_release_temporal_table(struct acpi_table_desc *table_desc)
+static void acpi_tb_release_temp_table(struct acpi_table_desc *table_desc)
{
+
/*
* Note that the .Address is maintained by the callers of
- * acpi_tb_acquire_temporal_table(), thus do not invoke acpi_tb_uninstall_table()
+ * acpi_tb_acquire_temp_table(), thus do not invoke acpi_tb_uninstall_table()
* where .Address will be freed.
*/
acpi_tb_invalidate_table(table_desc);
/*******************************************************************************
*
- * FUNCTION: acpi_tb_install_and_override_table
+ * FUNCTION: acpi_tb_install_table_with_override
*
* PARAMETERS: table_index - Index into root table array
* new_table_desc - New table descriptor to install
******************************************************************************/
void
-acpi_tb_install_and_override_table(u32 table_index,
- struct acpi_table_desc *new_table_desc,
- u8 override)
+acpi_tb_install_table_with_override(u32 table_index,
+ struct acpi_table_desc *new_table_desc,
+ u8 override)
{
+
if (table_index >= acpi_gbl_root_table_list.current_table_count) {
return;
}
acpi_tb_override_table(new_table_desc);
}
- acpi_tb_install_table(&acpi_gbl_root_table_list.tables[table_index],
- new_table_desc->address, new_table_desc->flags,
- new_table_desc->pointer);
+ acpi_tb_init_table_descriptor(&acpi_gbl_root_table_list.
+ tables[table_index],
+ new_table_desc->address,
+ new_table_desc->flags,
+ new_table_desc->pointer);
acpi_tb_print_table_header(new_table_desc->address,
new_table_desc->pointer);
/* Fill a table descriptor for validation */
- status = acpi_tb_acquire_temporal_table(&new_table_desc, address,
- ACPI_TABLE_ORIGIN_INTERN_PHYSICAL);
+ status = acpi_tb_acquire_temp_table(&new_table_desc, address,
+ ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
if (ACPI_FAILURE(status)) {
ACPI_ERROR((AE_INFO, "Could not acquire table length at %p",
ACPI_CAST_PTR(void, address)));
goto release_and_exit;
}
- acpi_tb_install_and_override_table(table_index, &new_table_desc, TRUE);
+ acpi_tb_install_table_with_override(table_index, &new_table_desc, TRUE);
release_and_exit:
- /* Release the temporal table descriptor */
+ /* Release the temporary table descriptor */
- acpi_tb_release_temporal_table(&new_table_desc);
+ acpi_tb_release_temp_table(&new_table_desc);
return_ACPI_STATUS(status);
}
/* Release the acquired table */
acpi_tb_release_table(table, table_length, table_flags);
-
return (is_equivalent);
}
/*******************************************************************************
*
- * FUNCTION: acpi_tb_install_non_fixed_table
+ * FUNCTION: acpi_tb_install_standard_table
*
* PARAMETERS: address - Address of the table (might be a virtual
* address depending on the table_flags)
* RETURN: Status
*
* DESCRIPTION: This function is called to install an ACPI table that is
- * neither DSDT nor FACS.
+ * neither DSDT nor FACS (a "standard" table.)
* When this function is called by "Load" or "LoadTable" opcodes,
* or by acpi_load_table() API, the "Reload" parameter is set.
* After sucessfully returning from this function, table is
******************************************************************************/
acpi_status
-acpi_tb_install_non_fixed_table(acpi_physical_address address,
- u8 flags,
- u8 reload, u8 override, u32 *table_index)
+acpi_tb_install_standard_table(acpi_physical_address address,
+ u8 flags,
+ u8 reload, u8 override, u32 *table_index)
{
u32 i;
acpi_status status = AE_OK;
struct acpi_table_desc new_table_desc;
- ACPI_FUNCTION_TRACE(tb_install_non_fixed_table);
+ ACPI_FUNCTION_TRACE(tb_install_standard_table);
- /* Acquire a temporal table descriptor for validation */
+ /* Acquire a temporary table descriptor for validation */
- status =
- acpi_tb_acquire_temporal_table(&new_table_desc, address, flags);
+ status = acpi_tb_acquire_temp_table(&new_table_desc, address, flags);
if (ACPI_FAILURE(status)) {
ACPI_ERROR((AE_INFO, "Could not acquire table length at %p",
ACPI_CAST_PTR(void, address)));
* Optionally do not load any SSDTs from the RSDT/XSDT. This can
* be useful for debugging ACPI problems on some machines.
*/
- if (!reload && acpi_gbl_disable_ssdt_table_install &&
+ if (!reload &&
+ acpi_gbl_disable_ssdt_table_install &&
ACPI_COMPARE_NAME(&new_table_desc.signature, ACPI_SIG_SSDT)) {
ACPI_INFO((AE_INFO, "Ignoring installation of %4.4s at %p",
new_table_desc.signature.ascii, ACPI_CAST_PTR(void,
* As we are going to return AE_OK to the caller, we should
* take the responsibility of freeing the input descriptor.
* Refill the input descriptor to ensure
- * acpi_tb_install_and_override_table() can be called again to
+ * acpi_tb_install_table_with_override() can be called again to
* indicate the re-installation.
*/
acpi_tb_uninstall_table(&new_table_desc);
/* Add the table to the global root table list */
- status = acpi_tb_acquire_root_table_entry(&i);
+ status = acpi_tb_get_root_table_entry(&i);
if (ACPI_FAILURE(status)) {
goto release_and_exit;
}
+
*table_index = i;
- acpi_tb_install_and_override_table(i, &new_table_desc, override);
+ acpi_tb_install_table_with_override(i, &new_table_desc, override);
release_and_exit:
- /* Release the temporal table descriptor */
+ /* Release the temporary table descriptor */
- acpi_tb_release_temporal_table(&new_table_desc);
+ acpi_tb_release_temp_table(&new_table_desc);
return_ACPI_STATUS(status);
}
status = acpi_os_table_override(old_table_desc->pointer, &table);
if (ACPI_SUCCESS(status) && table) {
- acpi_tb_acquire_temporal_table(&new_table_desc,
- ACPI_PTR_TO_PHYSADDR(table),
- ACPI_TABLE_ORIGIN_EXTERN_VIRTUAL);
+ acpi_tb_acquire_temp_table(&new_table_desc,
+ ACPI_PTR_TO_PHYSADDR(table),
+ ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL);
override_type = "Logical";
goto finish_override;
}
status = acpi_os_physical_table_override(old_table_desc->pointer,
&address, &length);
if (ACPI_SUCCESS(status) && address && length) {
- acpi_tb_acquire_temporal_table(&new_table_desc, address,
- ACPI_TABLE_ORIGIN_INTERN_PHYSICAL);
+ acpi_tb_acquire_temp_table(&new_table_desc, address,
+ ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
override_type = "Physical";
goto finish_override;
}
* Replace the original table descriptor and keep its state as
* "VALIDATED".
*/
- acpi_tb_install_table(old_table_desc, new_table_desc.address,
- new_table_desc.flags, new_table_desc.pointer);
+ acpi_tb_init_table_descriptor(old_table_desc, new_table_desc.address,
+ new_table_desc.flags,
+ new_table_desc.pointer);
acpi_tb_validate_table(old_table_desc);
- /* Release the temporal table descriptor */
+ /* Release the temporary table descriptor */
- acpi_tb_release_temporal_table(&new_table_desc);
+ acpi_tb_release_temp_table(&new_table_desc);
}
/*******************************************************************************
/*******************************************************************************
*
- * FUNCTION: acpi_tb_acquire_root_table_entry
+ * FUNCTION: acpi_tb_get_root_table_entry
*
* PARAMETERS: table_index - Where table index is returned
*
*
******************************************************************************/
-static acpi_status acpi_tb_acquire_root_table_entry(u32 *table_index)
+static acpi_status acpi_tb_get_root_table_entry(u32 *table_index)
{
acpi_status status;
* PARAMETERS: address - Table address
* table - Table header
* length - Table length
- * flags - flags
+ * flags - Install flags
+ * table_index - Where the table index is returned
*
* RETURN: Status and table index.
*
acpi_status status;
struct acpi_table_desc *table_desc;
- status = acpi_tb_acquire_root_table_entry(table_index);
+ status = acpi_tb_get_root_table_entry(table_index);
if (ACPI_FAILURE(status)) {
return (status);
}
/* Initialize added table */
table_desc = &acpi_gbl_root_table_list.tables[*table_index];
- acpi_tb_install_table(table_desc, address, flags, table);
+ acpi_tb_init_table_descriptor(table_desc, address, flags, table);
table_desc->pointer = table;
-
return (AE_OK);
}
acpi_tb_invalidate_table(table_desc);
if ((table_desc->flags & ACPI_TABLE_ORIGIN_MASK) ==
- ACPI_TABLE_ORIGIN_INTERN_VIRTUAL) {
+ ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL) {
ACPI_FREE(ACPI_CAST_PTR(void, table_desc->address));
}
table_desc->address = ACPI_PTR_TO_PHYSADDR(NULL);
-
return_VOID;
}
acpi_gbl_root_table_list.current_table_count = 0;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "ACPI Tables freed\n"));
- (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
+ (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
return_VOID;
}
(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
if (table_index < acpi_gbl_root_table_list.current_table_count) {
- status = acpi_ut_allocate_owner_id
- (&(acpi_gbl_root_table_list.tables[table_index].owner_id));
+ status =
+ acpi_ut_allocate_owner_id(&
+ (acpi_gbl_root_table_list.
+ tables[table_index].owner_id));
}
(void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
*
* FUNCTION: acpi_tb_is_table_loaded
*
- * PARAMETERS: table_index - Table index
+ * PARAMETERS: table_index - Index into the root table
*
* RETURN: Table Loaded Flag
*