summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/compiler/dtio.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/dtio.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/dtio.c')
-rw-r--r--sys/contrib/dev/acpica/compiler/dtio.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/sys/contrib/dev/acpica/compiler/dtio.c b/sys/contrib/dev/acpica/compiler/dtio.c
index 39fb9da..e840fc9 100644
--- a/sys/contrib/dev/acpica/compiler/dtio.c
+++ b/sys/contrib/dev/acpica/compiler/dtio.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,10 +41,9 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DTIO_C__
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/compiler/dtcompiler.h>
+#include <contrib/dev/acpica/include/acapps.h>
#define _COMPONENT DT_COMPILER
ACPI_MODULE_NAME ("dtio")
@@ -132,7 +131,7 @@ DtTrim (
if (!ACPI_STRCMP (String, " "))
{
- ReturnString = UtLocalCalloc (1);
+ ReturnString = UtStringCacheCalloc (1);
return (ReturnString);
}
@@ -180,7 +179,7 @@ DtTrim (
/* Create the trimmed return string */
Length = ACPI_PTR_DIFF (End, Start) + 1;
- ReturnString = UtLocalCalloc (Length + 1);
+ ReturnString = UtStringCacheCalloc (Length + 1);
if (ACPI_STRLEN (Start))
{
ACPI_STRNCPY (ReturnString, Start, Length);
@@ -369,7 +368,7 @@ DtParseLine (
if ((Value && *Value) || IsNullString)
{
- Field = UtLocalCalloc (sizeof (DT_FIELD));
+ Field = UtFieldCacheCalloc ();
Field->Name = Name;
Field->Value = Value;
Field->Line = Line;
@@ -379,11 +378,7 @@ DtParseLine (
DtLinkField (Field);
}
- else /* Ignore this field, it has no valid data */
- {
- ACPI_FREE (Name);
- ACPI_FREE (Value);
- }
+ /* Else -- Ignore this field, it has no valid data */
return (AE_OK);
}
@@ -737,7 +732,11 @@ DtScanFile (
/* Get the file size */
- Gbl_InputByteCount = DtGetFileSize (Handle);
+ Gbl_InputByteCount = CmGetFileSize (Handle);
+ if (Gbl_InputByteCount == ACPI_UINT32_MAX)
+ {
+ AslAbort ();
+ }
Gbl_CurrentLineNumber = 0;
Gbl_CurrentLineOffset = 0;
@@ -816,7 +815,12 @@ DtOutputBinary (
/* Walk the entire parse tree, emitting the binary data */
DtWalkTableTree (RootTable, DtWriteBinary, NULL, NULL);
- Gbl_TableLength = DtGetFileSize (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
+
+ Gbl_TableLength = CmGetFileSize (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
+ if (Gbl_TableLength == ACPI_UINT32_MAX)
+ {
+ AslAbort ();
+ }
}
@@ -1025,6 +1029,8 @@ DtDumpSubtableList (
DbgPrint (ASL_DEBUG_OUTPUT,
"\nSubtable Tree: (Depth, Subtable, Length, TotalLength)\n\n");
DtWalkTableTree (Gbl_RootTable, DtDumpSubtableTree, NULL, NULL);
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "\n");
}
OpenPOWER on IntegriCloud