Commit fbdebc89 authored by Andy Grover's avatar Andy Grover

ACPI: Parse SSDTs in order discovered, as opposed to reverse order (Hrvoje Habjanic)

parent 5fdd86ae
...@@ -271,22 +271,40 @@ acpi_tb_init_table_descriptor ( ...@@ -271,22 +271,40 @@ acpi_tb_init_table_descriptor (
if (list_head->next) { if (list_head->next) {
return_ACPI_STATUS (AE_ALREADY_EXISTS); return_ACPI_STATUS (AE_ALREADY_EXISTS);
} }
}
/* table_desc->next = list_head->next;
* Link the new table in to the list of tables of this type. list_head->next = table_desc;
* Just insert at the start of the list, order unimportant.
*
* table_desc->Prev is already NULL from calloc()
*/
table_desc->next = list_head->next;
list_head->next = table_desc;
if (table_desc->next) { if (table_desc->next) {
table_desc->next->prev = table_desc; table_desc->next->prev = table_desc;
}
list_head->count++;
} }
else {
/*
* Link the new table in to the list of tables of this type.
* Insert at the end of the list, order IS IMPORTANT.
*
* table_desc->Prev & Next are already NULL from calloc()
*/
list_head->count++;
if (!list_head->next) {
list_head->next = table_desc;
}
else {
table_desc->next = list_head->next;
list_head->count++; while (table_desc->next->next) {
table_desc->next = table_desc->next->next;
}
table_desc->next->next = table_desc;
table_desc->prev = table_desc->next;
table_desc->next = NULL;
}
}
/* Finish initialization of the table descriptor */ /* Finish initialization of the table descriptor */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment