diff options
author | Nate Lawson <njl@FreeBSD.org> | 2003-12-09 02:45:16 +0000 |
---|---|---|
committer | Nate Lawson <njl@FreeBSD.org> | 2003-12-09 02:45:16 +0000 |
commit | e50beb517da1c050acb9fb2b9751bcd9651df1a1 (patch) | |
tree | 24e5ad5d8b4fb5681ddaa34c6ae30814c80ffe56 /sys/contrib/dev/acpica/tbinstal.c | |
parent | 4f023945aca7d5e935e9d22b62c9b02de662d383 (diff) | |
download | src-e50beb517da1c050acb9fb2b9751bcd9651df1a1.tar.gz src-e50beb517da1c050acb9fb2b9751bcd9651df1a1.zip |
Import ACPI-CA 20031203
Notes
Notes:
svn path=/vendor-sys/acpica/dist/; revision=123315
Diffstat (limited to 'sys/contrib/dev/acpica/tbinstal.c')
-rw-r--r-- | sys/contrib/dev/acpica/tbinstal.c | 65 |
1 files changed, 44 insertions, 21 deletions
diff --git a/sys/contrib/dev/acpica/tbinstal.c b/sys/contrib/dev/acpica/tbinstal.c index 4471e80871cb..691ef715a462 100644 --- a/sys/contrib/dev/acpica/tbinstal.c +++ b/sys/contrib/dev/acpica/tbinstal.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: tbinstal - ACPI table installation and removal - * $Revision: 69 $ + * $Revision: 72 $ * *****************************************************************************/ @@ -358,23 +358,45 @@ AcpiTbInitTableDescriptor ( { return_ACPI_STATUS (AE_ALREADY_EXISTS); } - } - /* - * Link the new table in to the list of tables of this type. - * Just insert at the start of the list, order unimportant. - * - * TableDesc->Prev is already NULL from calloc() - */ - TableDesc->Next = ListHead->Next; - ListHead->Next = TableDesc; + TableDesc->Next = ListHead->Next; + ListHead->Next = TableDesc; - if (TableDesc->Next) - { - TableDesc->Next->Prev = TableDesc; + if (TableDesc->Next) + { + TableDesc->Next->Prev = TableDesc; + } + + ListHead->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. + * + * TableDesc->Prev & Next are already NULL from calloc() + */ + ListHead->Count++; - ListHead->Count++; + if (!ListHead->Next) + { + ListHead->Next = TableDesc; + } + else + { + TableDesc->Next = ListHead->Next; + + while (TableDesc->Next->Next) + { + TableDesc->Next = TableDesc->Next->Next; + } + + TableDesc->Next->Next = TableDesc; + TableDesc->Prev = TableDesc->Next; + TableDesc->Next = NULL; + } + } /* Finish initialization of the table descriptor */ @@ -421,7 +443,7 @@ AcpiTbInitTableDescriptor ( void AcpiTbDeleteAllTables (void) { - ACPI_TABLE_TYPE Type; + ACPI_TABLE_TYPE Type; /* @@ -450,7 +472,7 @@ AcpiTbDeleteAllTables (void) void AcpiTbDeleteTablesByType ( - ACPI_TABLE_TYPE Type) + ACPI_TABLE_TYPE Type) { ACPI_TABLE_DESC *TableDesc; UINT32 Count; @@ -500,15 +522,16 @@ AcpiTbDeleteTablesByType ( break; } - /* Free the table */ - /* Get the head of the list */ - + /* + * Free the table + * 1) Get the head of the list + */ TableDesc = AcpiGbl_TableLists[Type].Next; Count = AcpiGbl_TableLists[Type].Count; /* - * Walk the entire list, deleting both the allocated tables - * and the table descriptors + * 2) Walk the entire list, deleting both the allocated tables + * and the table descriptors */ for (i = 0; i < Count; i++) { |