Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Bob Moore and committed by
Len Brown
a18ecf41 27a639a9

+30 -19
+17 -7
drivers/acpi/tables/tbutils.c
··· 80 80 /* Examine all installed tables of this type */ 81 81 82 82 while (table_desc) { 83 - /* Compare Revision and oem_table_id */ 84 - 83 + /* 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 92 if ((table_desc->loaded_into_namespace) && 86 - (table_desc->pointer->revision == 87 - new_table_desc->pointer->revision) && 88 - (!ACPI_MEMCMP(table_desc->pointer->oem_table_id, 89 - new_table_desc->pointer->oem_table_id, 8))) { 90 - /* This table is already installed */ 93 + (table_desc->pointer->length == 94 + new_table_desc->pointer->length) 95 + && 96 + (!ACPI_MEMCMP 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 102 ACPI_DEBUG_PRINT((ACPI_DB_TABLES, 93 103 "Table [%4.4s] already installed: Rev %X oem_table_id [%8.8s]\n",
+2 -2
drivers/acpi/utilities/utdebug.c
··· 122 122 123 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 126 /* This is the case where the original source has not been modified */ 127 127 128 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 132 /* This is the case where the source has been 'linuxized' */ 133 133 134 134 return (function_name + 5);
+5 -1
drivers/acpi/utilities/utmisc.c
··· 78 78 79 79 for (i = 0; i < 32; i++) { 80 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 85 acpi_gbl_owner_id_mask |= (1 << i); 82 86 *owner_id = (acpi_owner_id) (i + 1); 83 87 goto exit; ··· 123 119 acpi_owner_id owner_id = *owner_id_ptr; 124 120 acpi_status status; 125 121 126 - ACPI_FUNCTION_TRACE("ut_release_owner_id"); 122 + ACPI_FUNCTION_TRACE_U32("ut_release_owner_id", owner_id); 127 123 128 124 /* Always clear the input owner_id (zero is an invalid ID) */ 129 125
+1 -1
include/acpi/acconfig.h
··· 63 63 64 64 /* Version string */ 65 65 66 - #define ACPI_CA_VERSION 0x20050729 66 + #define ACPI_CA_VERSION 0x20050815 67 67 68 68 /* 69 69 * OS name, used for the _OS object. The _OS object is essentially obsolete,
+5 -8
include/acpi/acnames.h
··· 71 71 72 72 /* Definitions of the predefined namespace names */ 73 73 74 - #define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */ 75 - #define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */ 76 - #define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */ 74 + #define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */ 75 + #define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */ 76 + 77 + #define ACPI_PREFIX_MIXED (u32) 0x69706341 /* "Acpi" */ 78 + #define ACPI_PREFIX_LOWER (u32) 0x69706361 /* "acpi" */ 77 79 78 80 #define ACPI_NS_ROOT_PATH "\\" 79 81 #define ACPI_NS_SYSTEM_BUS "_SB_" 80 - 81 - /*! [Begin] no source code translation (not handled by acpisrc) */ 82 - #define ACPI_FUNCTION_PREFIX1 'ipcA' 83 - #define ACPI_FUNCTION_PREFIX2 'ipca' 84 - /*! [End] no source code translation !*/ 85 82 86 83 #endif /* __ACNAMES_H__ */