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

ACPICA: Add override for dynamic tables

Add a call to acpi_os_table_override during the installation of a
dynamic table (loaded via the Load or LoadTable AML operators).

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>

authored by

Bob Moore and committed by
Len Brown
d3ccaff8 97cbb7d1

+27 -1
+27 -1
drivers/acpi/acpica/tbinstal.c
··· 103 103 * 104 104 * RETURN: Status 105 105 * 106 - * DESCRIPTION: This function is called to add the ACPI table 106 + * DESCRIPTION: This function is called to add an ACPI table. It is used to 107 + * dynamically load tables via the Load and load_table AML 108 + * operators. 107 109 * 108 110 ******************************************************************************/ 109 111 ··· 114 112 { 115 113 u32 i; 116 114 acpi_status status = AE_OK; 115 + struct acpi_table_header *override_table = NULL; 117 116 118 117 ACPI_FUNCTION_TRACE(tb_add_table); 119 118 ··· 202 199 status = AE_OK; 203 200 goto print_header; 204 201 } 202 + } 203 + 204 + /* 205 + * ACPI Table Override: 206 + * Allow the host to override dynamically loaded tables. 207 + */ 208 + status = acpi_os_table_override(table_desc->pointer, &override_table); 209 + if (ACPI_SUCCESS(status) && override_table) { 210 + ACPI_INFO((AE_INFO, 211 + "%4.4s @ 0x%p Table override, replaced with:", 212 + table_desc->pointer->signature, 213 + ACPI_CAST_PTR(void, table_desc->address))); 214 + 215 + /* We can delete the table that was passed as a parameter */ 216 + 217 + acpi_tb_delete_table(table_desc); 218 + 219 + /* Setup descriptor for the new table */ 220 + 221 + table_desc->address = ACPI_PTR_TO_PHYSADDR(override_table); 222 + table_desc->pointer = override_table; 223 + table_desc->length = override_table->length; 224 + table_desc->flags = ACPI_TABLE_ORIGIN_OVERRIDE; 205 225 } 206 226 207 227 /* Add the table to the global root table list */