From 441da571d47ec226c5c1799fe6e9dad14931a813 Mon Sep 17 00:00:00 2001 From: dim Date: Sat, 4 Apr 2015 10:17:51 +0000 Subject: MFC r272444 (by jkim): Merge ACPICA 20140926. MFC r278970 (by jkim): Merge ACPICA 20141107 and 20150204. Approved by: jkim Relnotes: yes --- sys/contrib/dev/acpica/compiler/dtcompile.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'sys/contrib/dev/acpica/compiler/dtcompile.c') diff --git a/sys/contrib/dev/acpica/compiler/dtcompile.c b/sys/contrib/dev/acpica/compiler/dtcompile.c index 3407e1d..e94a222 100644 --- a/sys/contrib/dev/acpica/compiler/dtcompile.c +++ b/sys/contrib/dev/acpica/compiler/dtcompile.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#define __DTCOMPILE_C__ #define _DECLARE_DT_GLOBALS #include @@ -141,8 +140,6 @@ DtDoCompile ( Status = DtCompileDataTable (&FieldList); UtEndEvent (Event); - DtFreeFieldList (); - if (ACPI_FAILURE (Status)) { /* TBD: temporary error message. Msgs should come from function above */ @@ -170,6 +167,8 @@ DtDoCompile ( CleanupAndExit: + AcpiUtDeleteCaches (); + DtDeleteCaches (); CmCleanupAndExit (); return (Status); } @@ -298,7 +297,7 @@ DtCompileDataTable ( return (AE_ERROR); } - Gbl_Signature = UtLocalCalloc (ACPI_STRLEN (Signature) + 1); + Gbl_Signature = UtStringCacheCalloc (ACPI_STRLEN (Signature) + 1); strcpy (Gbl_Signature, Signature); /* @@ -437,6 +436,7 @@ DtCompileTable ( UINT8 FieldType; UINT8 *Buffer; UINT8 *FlagBuffer = NULL; + char *String; UINT32 CurrentFlagByteOffset = 0; ACPI_STATUS Status; @@ -446,18 +446,29 @@ DtCompileTable ( return (AE_BAD_PARAMETER); } + /* Ignore optional subtable if name does not match */ + + if ((Info->Flags & DT_OPTIONAL) && + ACPI_STRCMP ((*Field)->Name, Info->Name)) + { + *RetSubtable = NULL; + return (AE_OK); + } + Length = DtGetSubtableLength (*Field, Info); if (Length == ASL_EOF) { return (AE_ERROR); } - Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE)); + Subtable = UtSubtableCacheCalloc (); if (Length > 0) { - Subtable->Buffer = UtLocalCalloc (Length); + String = UtStringCacheCalloc (Length); + Subtable->Buffer = ACPI_CAST_PTR (UINT8, String); } + Subtable->Length = Length; Subtable->TotalLength = Length; Buffer = Subtable->Buffer; @@ -558,8 +569,6 @@ DtCompileTable ( DtSetSubtableLength (InlineSubtable); ACPI_MEMCPY (Buffer, InlineSubtable->Buffer, FieldLength); - ACPI_FREE (InlineSubtable->Buffer); - ACPI_FREE (InlineSubtable); LocalField = *Field; break; -- cgit v1.1