diff options
author | Robert Moore <robert.moore@intel.com> | 2005-07-29 15:15:00 -0700 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-07-30 00:51:39 -0400 |
commit | 0c9938cc75057c0fca1af55a55dcfc2842436695 (patch) | |
tree | d18e809bf9e3811f20c609b6515d4d1b8520cfbc /drivers/acpi/tables/tbutils.c | |
parent | dd8f39bbf5154cdbfd698fc70c66faba33eafa44 (diff) | |
download | blackbird-op-linux-0c9938cc75057c0fca1af55a55dcfc2842436695.tar.gz blackbird-op-linux-0c9938cc75057c0fca1af55a55dcfc2842436695.zip |
[ACPI] ACPICA 20050729 from Bob Moore
Implemented support to ignore an attempt to install/load
a particular ACPI table more than once. Apparently there
exists BIOS code that repeatedly attempts to load the same
SSDT upon certain events. Thanks to Venkatesh Pallipadi.
Restructured the main interface to the AML parser in
order to correctly handle all exceptional conditions. This
will prevent leakage of the OwnerId resource and should
eliminate the AE_OWNER_ID_LIMIT exceptions seen on some
machines. Thanks to Alexey Starikovskiy.
Support for "module level code" has been disabled in this
version due to a number of issues that have appeared
on various machines. The support can be enabled by
defining ACPI_ENABLE_MODULE_LEVEL_CODE during subsystem
compilation. When the issues are fully resolved, the code
will be enabled by default again.
Modified the internal functions for debug print support
to define the FunctionName parameter as a (const char *)
for compatibility with compiler built-in macros such as
__FUNCTION__, etc.
Linted the entire ACPICA source tree for both 32-bit
and 64-bit.
Signed-off-by: Robert Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/tables/tbutils.c')
-rw-r--r-- | drivers/acpi/tables/tbutils.c | 67 |
1 files changed, 64 insertions, 3 deletions
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c index e69d01d443d2..6fc1e36e6042 100644 --- a/drivers/acpi/tables/tbutils.c +++ b/drivers/acpi/tables/tbutils.c @@ -61,6 +61,67 @@ acpi_tb_handle_to_object ( /******************************************************************************* * + * FUNCTION: acpi_tb_is_table_installed + * + * PARAMETERS: new_table_desc - Descriptor for new table being installed + * + * RETURN: Status - AE_ALREADY_EXISTS if the table is already installed + * + * DESCRIPTION: Determine if an ACPI table is already installed + * + * MUTEX: Table data structures should be locked + * + ******************************************************************************/ + +acpi_status +acpi_tb_is_table_installed ( + struct acpi_table_desc *new_table_desc) +{ + struct acpi_table_desc *table_desc; + + + ACPI_FUNCTION_TRACE ("tb_is_table_installed"); + + + /* Get the list descriptor and first table descriptor */ + + table_desc = acpi_gbl_table_lists[new_table_desc->type].next; + + /* Examine all installed tables of this type */ + + while (table_desc) { + /* Compare Revision and oem_table_id */ + + if ((table_desc->loaded_into_namespace) && + (table_desc->pointer->revision == + new_table_desc->pointer->revision) && + (!ACPI_MEMCMP (table_desc->pointer->oem_table_id, + new_table_desc->pointer->oem_table_id, 8))) { + /* This table is already installed */ + + ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, + "Table [%4.4s] already installed: Rev %X oem_table_id [%8.8s]\n", + new_table_desc->pointer->signature, + new_table_desc->pointer->revision, + new_table_desc->pointer->oem_table_id)); + + new_table_desc->owner_id = table_desc->owner_id; + new_table_desc->installed_desc = table_desc; + + return_ACPI_STATUS (AE_ALREADY_EXISTS); + } + + /* Get next table on the list */ + + table_desc = table_desc->next; + } + + return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * * FUNCTION: acpi_tb_validate_table_header * * PARAMETERS: table_header - Logical pointer to the table @@ -157,7 +218,7 @@ acpi_tb_verify_table_checksum ( /* Compute the checksum on the table */ - checksum = acpi_tb_checksum (table_header, table_header->length); + checksum = acpi_tb_generate_checksum (table_header, table_header->length); /* Return the appropriate exception */ @@ -175,7 +236,7 @@ acpi_tb_verify_table_checksum ( /******************************************************************************* * - * FUNCTION: acpi_tb_checksum + * FUNCTION: acpi_tb_generate_checksum * * PARAMETERS: Buffer - Buffer to checksum * Length - Size of the buffer @@ -187,7 +248,7 @@ acpi_tb_verify_table_checksum ( ******************************************************************************/ u8 -acpi_tb_checksum ( +acpi_tb_generate_checksum ( void *buffer, u32 length) { |