aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/tables/tbutils.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2005-08-15 03:42:00 -0800
committerLen Brown <len.brown@intel.com>2005-08-29 23:44:25 -0400
commita18ecf413ca9846becb760f7f990c2c62c15965e (patch)
treecbcb4e7c8818e3e57f07c9104d5a74e3d6b30565 /drivers/acpi/tables/tbutils.c
parent27a639a92d3289c4851105efcbc2f8b88969194f (diff)
[ACPI] ACPICA 20050815
Implemented a full bytewise compare to determine if a table load request is attempting to load a duplicate table. The compare is performed if the table signatures and table lengths match. This will allow different tables with the same OEM Table ID and revision to be loaded. Although the BIOS is technically violating the ACPI spec when this happens -- it does happen -- so Linux must handle it. 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.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
index 5bcafebb9dd..4b2fbb592f4 100644
--- a/drivers/acpi/tables/tbutils.c
+++ b/drivers/acpi/tables/tbutils.c
@@ -80,14 +80,24 @@ acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc)
/* Examine all installed tables of this type */
while (table_desc) {
- /* Compare Revision and oem_table_id */
-
+ /*
+ * If the table lengths match, perform a full bytewise compare. This
+ * means that we will allow tables with duplicate oem_table_id(s), as
+ * long as the tables are different in some way.
+ *
+ * Checking if the table has been loaded into the namespace means that
+ * we don't check for duplicate tables during the initial installation
+ * of tables within the RSDT/XSDT.
+ */
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 */
+ (table_desc->pointer->length ==
+ new_table_desc->pointer->length)
+ &&
+ (!ACPI_MEMCMP
+ ((const char *)table_desc->pointer,
+ (const char *)new_table_desc->pointer,
+ (acpi_size) new_table_desc->pointer->length))) {
+ /* Match: this table is already installed */
ACPI_DEBUG_PRINT((ACPI_DB_TABLES,
"Table [%4.4s] already installed: Rev %X oem_table_id [%8.8s]\n",