diff options
author | Bob Moore <robert.moore@intel.com> | 2005-08-15 07:42:00 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-08-29 23:44:25 -0400 |
commit | a18ecf413ca9846becb760f7f990c2c62c15965e (patch) | |
tree | cbcb4e7c8818e3e57f07c9104d5a74e3d6b30565 /drivers | |
parent | 27a639a92d3289c4851105efcbc2f8b88969194f (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')
-rw-r--r-- | drivers/acpi/tables/tbutils.c | 24 | ||||
-rw-r--r-- | drivers/acpi/utilities/utdebug.c | 4 | ||||
-rw-r--r-- | drivers/acpi/utilities/utmisc.c | 6 |
3 files changed, 24 insertions, 10 deletions
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c index 5bcafebb9ddf..4b2fbb592f49 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) | |||
80 | /* Examine all installed tables of this type */ | 80 | /* Examine all installed tables of this type */ |
81 | 81 | ||
82 | while (table_desc) { | 82 | while (table_desc) { |
83 | /* Compare Revision and oem_table_id */ | 83 | /* |
84 | 84 | * If the table lengths match, perform a full bytewise compare. This | |
85 | * means that we will allow tables with duplicate oem_table_id(s), as | ||
86 | * long as the tables are different in some way. | ||
87 | * | ||
88 | * Checking if the table has been loaded into the namespace means that | ||
89 | * we don't check for duplicate tables during the initial installation | ||
90 | * of tables within the RSDT/XSDT. | ||
91 | */ | ||
85 | if ((table_desc->loaded_into_namespace) && | 92 | if ((table_desc->loaded_into_namespace) && |
86 | (table_desc->pointer->revision == | 93 | (table_desc->pointer->length == |
87 | new_table_desc->pointer->revision) && | 94 | new_table_desc->pointer->length) |
88 | (!ACPI_MEMCMP(table_desc->pointer->oem_table_id, | 95 | && |
89 | new_table_desc->pointer->oem_table_id, 8))) { | 96 | (!ACPI_MEMCMP |
90 | /* This table is already installed */ | 97 | ((const char *)table_desc->pointer, |
98 | (const char *)new_table_desc->pointer, | ||
99 | (acpi_size) new_table_desc->pointer->length))) { | ||
100 | /* Match: this table is already installed */ | ||
91 | 101 | ||
92 | ACPI_DEBUG_PRINT((ACPI_DB_TABLES, | 102 | ACPI_DEBUG_PRINT((ACPI_DB_TABLES, |
93 | "Table [%4.4s] already installed: Rev %X oem_table_id [%8.8s]\n", | 103 | "Table [%4.4s] already installed: Rev %X oem_table_id [%8.8s]\n", |
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c index 081a778aba88..d80e92639932 100644 --- a/drivers/acpi/utilities/utdebug.c +++ b/drivers/acpi/utilities/utdebug.c | |||
@@ -122,13 +122,13 @@ static const char *acpi_ut_trim_function_name(const char *function_name) | |||
122 | 122 | ||
123 | /* All Function names are longer than 4 chars, check is safe */ | 123 | /* All Function names are longer than 4 chars, check is safe */ |
124 | 124 | ||
125 | if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_FUNCTION_PREFIX1) { | 125 | if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_MIXED) { |
126 | /* This is the case where the original source has not been modified */ | 126 | /* This is the case where the original source has not been modified */ |
127 | 127 | ||
128 | return (function_name + 4); | 128 | return (function_name + 4); |
129 | } | 129 | } |
130 | 130 | ||
131 | if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_FUNCTION_PREFIX2) { | 131 | if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_LOWER) { |
132 | /* This is the case where the source has been 'linuxized' */ | 132 | /* This is the case where the source has been 'linuxized' */ |
133 | 133 | ||
134 | return (function_name + 5); | 134 | return (function_name + 5); |
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c index 474fe7cb6c09..f0275025b718 100644 --- a/drivers/acpi/utilities/utmisc.c +++ b/drivers/acpi/utilities/utmisc.c | |||
@@ -78,6 +78,10 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) | |||
78 | 78 | ||
79 | for (i = 0; i < 32; i++) { | 79 | for (i = 0; i < 32; i++) { |
80 | if (!(acpi_gbl_owner_id_mask & (1 << i))) { | 80 | if (!(acpi_gbl_owner_id_mask & (1 << i))) { |
81 | ACPI_DEBUG_PRINT((ACPI_DB_VALUES, | ||
82 | "Current owner_id mask: %8.8X New ID: %2.2X\n", | ||
83 | acpi_gbl_owner_id_mask, (i + 1))); | ||
84 | |||
81 | acpi_gbl_owner_id_mask |= (1 << i); | 85 | acpi_gbl_owner_id_mask |= (1 << i); |
82 | *owner_id = (acpi_owner_id) (i + 1); | 86 | *owner_id = (acpi_owner_id) (i + 1); |
83 | goto exit; | 87 | goto exit; |
@@ -119,7 +123,7 @@ void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr) | |||
119 | acpi_owner_id owner_id = *owner_id_ptr; | 123 | acpi_owner_id owner_id = *owner_id_ptr; |
120 | acpi_status status; | 124 | acpi_status status; |
121 | 125 | ||
122 | ACPI_FUNCTION_TRACE("ut_release_owner_id"); | 126 | ACPI_FUNCTION_TRACE_U32("ut_release_owner_id", owner_id); |
123 | 127 | ||
124 | /* Always clear the input owner_id (zero is an invalid ID) */ | 128 | /* Always clear the input owner_id (zero is an invalid ID) */ |
125 | 129 | ||