summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/compiler/dtcompile.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-04-04 10:17:51 +0000
committerdim <dim@FreeBSD.org>2015-04-04 10:17:51 +0000
commit441da571d47ec226c5c1799fe6e9dad14931a813 (patch)
tree03ae73b5fa8cee569039a08677ba8f5db4c7032b /sys/contrib/dev/acpica/compiler/dtcompile.c
parenta66c38928305566ab81042d4242432a649ec767f (diff)
downloadFreeBSD-src-441da571d47ec226c5c1799fe6e9dad14931a813.zip
FreeBSD-src-441da571d47ec226c5c1799fe6e9dad14931a813.tar.gz
MFC r272444 (by jkim):
Merge ACPICA 20140926. MFC r278970 (by jkim): Merge ACPICA 20141107 and 20150204. Approved by: jkim Relnotes: yes
Diffstat (limited to 'sys/contrib/dev/acpica/compiler/dtcompile.c')
-rw-r--r--sys/contrib/dev/acpica/compiler/dtcompile.c27
1 files changed, 18 insertions, 9 deletions
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 <contrib/dev/acpica/compiler/aslcompiler.h>
@@ -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;
OpenPOWER on IntegriCloud