ACPI / tables: add DSDT AmlCode new declaration name support
[sfrench/cifs-2.6.git] / drivers / acpi / tables.c
index 61203eebf3a1ae8cc3e70a7658b49cd39a8f249a..ccb90eff00e5e24585785c663f2215cf8708c67b 100644 (file)
@@ -712,6 +712,9 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table,
                                          table_length);
 }
 
+static void *amlcode __attribute__ ((weakref("AmlCode")));
+static void *dsdt_amlcode __attribute__ ((weakref("dsdt_aml_code")));
+
 acpi_status
 acpi_os_table_override(struct acpi_table_header *existing_table,
                       struct acpi_table_header **new_table)
@@ -722,8 +725,11 @@ acpi_os_table_override(struct acpi_table_header *existing_table,
        *new_table = NULL;
 
 #ifdef CONFIG_ACPI_CUSTOM_DSDT
-       if (strncmp(existing_table->signature, "DSDT", 4) == 0)
-               *new_table = (struct acpi_table_header *)AmlCode;
+       if (!strncmp(existing_table->signature, "DSDT", 4)) {
+               *new_table = (struct acpi_table_header *)&amlcode;
+               if (!(*new_table))
+                       *new_table = (struct acpi_table_header *)&dsdt_amlcode;
+       }
 #endif
        if (*new_table != NULL)
                acpi_table_taint(existing_table);