summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/compiler
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2009-11-16 21:47:12 +0000
committerjkim <jkim@FreeBSD.org>2009-11-16 21:47:12 +0000
commite91f3d64cb04487a4cd6735c61aa31841a658931 (patch)
tree740092acb1263b9bf77e2934f2697cd8a2a6c86b /sys/contrib/dev/acpica/compiler
parent3ca04f8b5de8c07bab51bd14e27544f94dccf809 (diff)
parent33700bac1d344f0be40cccaba4df65da92a70fbf (diff)
downloadFreeBSD-src-e91f3d64cb04487a4cd6735c61aa31841a658931.zip
FreeBSD-src-e91f3d64cb04487a4cd6735c61aa31841a658931.tar.gz
Merge ACPICA 20091112.
Diffstat (limited to 'sys/contrib/dev/acpica/compiler')
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcompile.c14
-rw-r--r--sys/contrib/dev/acpica/compiler/aslerror.c1
-rw-r--r--sys/contrib/dev/acpica/compiler/asllookup.c8
-rw-r--r--sys/contrib/dev/acpica/compiler/asloperands.c24
-rw-r--r--sys/contrib/dev/acpica/compiler/asltransform.c43
-rw-r--r--sys/contrib/dev/acpica/compiler/asltypes.h6
6 files changed, 65 insertions, 31 deletions
diff --git a/sys/contrib/dev/acpica/compiler/aslcompile.c b/sys/contrib/dev/acpica/compiler/aslcompile.c
index dda3ce3..800d307 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompile.c
+++ b/sys/contrib/dev/acpica/compiler/aslcompile.c
@@ -895,13 +895,6 @@ CmCleanupAndExit (
10) / Gbl_NsLookupCount);
}
- /* Close all open files */
-
- for (i = 2; i < ASL_MAX_FILE_TYPE; i++)
- {
- FlCloseFile (i);
- }
-
/*
* TBD: SourceOutput should be .TMP, then rename if we want to keep it?
*/
@@ -923,6 +916,13 @@ CmCleanupAndExit (
}
UtDisplaySummary (ASL_FILE_STDOUT);
+
+ /* Close all open files */
+
+ for (i = 2; i < ASL_MAX_FILE_TYPE; i++)
+ {
+ FlCloseFile (i);
+ }
}
diff --git a/sys/contrib/dev/acpica/compiler/aslerror.c b/sys/contrib/dev/acpica/compiler/aslerror.c
index 2591dfe..0762bb3 100644
--- a/sys/contrib/dev/acpica/compiler/aslerror.c
+++ b/sys/contrib/dev/acpica/compiler/aslerror.c
@@ -535,6 +535,7 @@ AslCommonError (
Gbl_NextError = Gbl_ErrorLog;
CmDoOutputFiles ();
CmCleanupAndExit ();
+ exit(1);
}
return;
diff --git a/sys/contrib/dev/acpica/compiler/asllookup.c b/sys/contrib/dev/acpica/compiler/asllookup.c
index 716e9f9..73cd314 100644
--- a/sys/contrib/dev/acpica/compiler/asllookup.c
+++ b/sys/contrib/dev/acpica/compiler/asllookup.c
@@ -526,7 +526,7 @@ LsDisplayNamespace (
/* Walk entire namespace from the root */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, FALSE, LsDoOneNamespaceObject,
+ ACPI_UINT32_MAX, FALSE, LsDoOneNamespaceObject, NULL,
NULL, NULL);
/* Print the full pathname for each namespace node */
@@ -534,7 +534,7 @@ LsDisplayNamespace (
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\nNamespace pathnames\n\n");
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, FALSE, LsDoOnePathname,
+ ACPI_UINT32_MAX, FALSE, LsDoOnePathname, NULL,
NULL, NULL);
return (Status);
@@ -598,7 +598,7 @@ LkObjectExists (
/* Walk entire namespace from the supplied root */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, FALSE, LsCompareOneNamespaceObject,
+ ACPI_UINT32_MAX, FALSE, LsCompareOneNamespaceObject, NULL,
Name, NULL);
if (Status == AE_CTRL_TRUE)
{
@@ -753,7 +753,7 @@ LkFindUnreferencedObjects (
/* Walk entire namespace from the supplied root */
(void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, FALSE, LkIsObjectUsed,
+ ACPI_UINT32_MAX, FALSE, LkIsObjectUsed, NULL,
NULL, NULL);
}
diff --git a/sys/contrib/dev/acpica/compiler/asloperands.c b/sys/contrib/dev/acpica/compiler/asloperands.c
index 4e6d3b1..418abd9 100644
--- a/sys/contrib/dev/acpica/compiler/asloperands.c
+++ b/sys/contrib/dev/acpica/compiler/asloperands.c
@@ -788,20 +788,30 @@ OpnDoPackage (
if ((PackageLengthOp->Asl.ParseOpcode == PARSEOP_INTEGER) ||
(PackageLengthOp->Asl.ParseOpcode == PARSEOP_QWORDCONST))
{
- if (PackageLengthOp->Asl.Value.Integer >= PackageLength)
+ if (PackageLengthOp->Asl.Value.Integer > PackageLength)
{
- /* Allow package to be longer than the initializer list */
+ /*
+ * Allow package length to be longer than the initializer
+ * list -- but if the length of initializer list is nonzero,
+ * issue a message since this is probably a coding error,
+ * even though technically legal.
+ */
+ if (PackageLength > 0)
+ {
+ AslError (ASL_REMARK, ASL_MSG_LIST_LENGTH_SHORT,
+ PackageLengthOp, NULL);
+ }
PackageLength = (UINT32) PackageLengthOp->Asl.Value.Integer;
}
- else
+ else if (PackageLengthOp->Asl.Value.Integer < PackageLength)
{
/*
- * Initializer list is longer than the package length. This
- * is an error as per the ACPI spec.
+ * The package length is smaller than the length of the
+ * initializer list. This is an error as per the ACPI spec.
*/
- AslError (ASL_ERROR, ASL_MSG_LIST_LENGTH,
- PackageLengthOp->Asl.Next, NULL);
+ AslError (ASL_ERROR, ASL_MSG_LIST_LENGTH_LONG,
+ PackageLengthOp, NULL);
}
}
diff --git a/sys/contrib/dev/acpica/compiler/asltransform.c b/sys/contrib/dev/acpica/compiler/asltransform.c
index ca0d4b8..3fa2dee 100644
--- a/sys/contrib/dev/acpica/compiler/asltransform.c
+++ b/sys/contrib/dev/acpica/compiler/asltransform.c
@@ -468,6 +468,8 @@ TrDoSwitch (
ACPI_PARSE_OBJECT *NewOp;
ACPI_PARSE_OBJECT *NewOp2;
ACPI_PARSE_OBJECT *MethodOp;
+ ACPI_PARSE_OBJECT *StoreOp;
+ ACPI_PARSE_OBJECT *BreakOp;
char *PredicateValueName;
UINT16 Index;
UINT32 Btype;
@@ -638,11 +640,7 @@ TrDoSwitch (
*/
if (CurrentParentNode == StartNode)
{
- Conditional->Asl.Parent = CurrentParentNode->Asl.Parent;
-
- /* Link IF into the peer list */
-
- TrAmlInsertPeer (CurrentParentNode, Conditional);
+ Conditional->Asl.Next = NULL;
}
else
{
@@ -695,6 +693,7 @@ TrDoSwitch (
{
return;
}
+
TrAmlInitNode (DefaultOp, PARSEOP_ELSE);
DefaultOp->Asl.Parent = Conditional->Asl.Parent;
@@ -799,22 +798,44 @@ TrDoSwitch (
TrAmlSetSubtreeParent (NewOp2, NewOp);
/*
- * Transform the Switch() into a Store() node which will be used to save the
+ * Transform the Switch() into a While(One)-Break node.
+ * And create a Store() node which will be used to save the
* Switch() value. The store is of the form: Store (Value, _T_x)
* where _T_x is the temp variable.
*/
- TrAmlInitNode (StartNode, PARSEOP_STORE);
- StartNode->Asl.Child = NULL;
+ TrAmlInitNode (StartNode, PARSEOP_WHILE);
+ NewOp = TrCreateLeafNode (PARSEOP_ONE);
+ NewOp->Asl.Next = Predicate->Asl.Next;
+ NewOp->Asl.Parent = StartNode;
+ StartNode->Asl.Child = NewOp;
+
+ /* Create a Store() node */
+
+ StoreOp = TrCreateLeafNode (PARSEOP_STORE);
+ StoreOp->Asl.Parent = StartNode;
+ TrAmlInsertPeer (NewOp, StoreOp);
/* Complete the Store subtree */
- StartNode->Asl.Child = Predicate;
- Predicate->Asl.Parent = StartNode;
+ StoreOp->Asl.Child = Predicate;
+ Predicate->Asl.Parent = StoreOp;
NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG,
(ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName));
- NewOp->Asl.Parent = StartNode;
+ NewOp->Asl.Parent = StoreOp;
Predicate->Asl.Next = NewOp;
+
+ /* Create a Break() node and insert it into the end of While() */
+
+ Conditional = StartNode->Asl.Child;
+ while (Conditional->Asl.Next)
+ {
+ Conditional = Conditional->Asl.Next;
+ }
+
+ BreakOp = TrCreateLeafNode (PARSEOP_BREAK);
+ BreakOp->Asl.Parent = StartNode;
+ TrAmlInsertPeer (Conditional, BreakOp);
}
diff --git a/sys/contrib/dev/acpica/compiler/asltypes.h b/sys/contrib/dev/acpica/compiler/asltypes.h
index fb2396f..0500ba9 100644
--- a/sys/contrib/dev/acpica/compiler/asltypes.h
+++ b/sys/contrib/dev/acpica/compiler/asltypes.h
@@ -369,7 +369,8 @@ typedef enum
ASL_MSG_INVALID_TIME,
ASL_MSG_INVALID_TYPE,
ASL_MSG_INVALID_UUID,
- ASL_MSG_LIST_LENGTH,
+ ASL_MSG_LIST_LENGTH_LONG,
+ ASL_MSG_LIST_LENGTH_SHORT,
ASL_MSG_LISTING_FILE_OPEN,
ASL_MSG_LISTING_FILENAME,
ASL_MSG_LOCAL_INIT,
@@ -488,7 +489,8 @@ char *AslMessages [] = {
/* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)",
/* ASL_MSG_INVALID_TYPE */ "Invalid type",
/* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"",
-/* ASL_MSG_LIST_LENGTH */ "Initializer list too long",
+/* ASL_MSG_LIST_LENGTH_LONG */ "Initializer list longer than declared package length",
+/* ASL_MSG_LIST_LENGTH_SHORT */ "Initializer list shorter than declared package length",
/* ASL_MSG_LISTING_FILE_OPEN */ "Could not open listing file",
/* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename",
/* ASL_MSG_LOCAL_INIT */ "Method local variable is not initialized",
OpenPOWER on IntegriCloud