summaryrefslogtreecommitdiffstats
path: root/source/components/parser
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2012-10-19 18:47:57 +0000
committerjkim <jkim@FreeBSD.org>2012-10-19 18:47:57 +0000
commitd8cd02b5b5893df382c08566087e32fe5b0c3abb (patch)
tree5e268c18ae0fa3ec73e13e2af60a3be57d8393ec /source/components/parser
parentda9b951a892d96e0521abeec09d4345ddf04ab8d (diff)
downloadFreeBSD-src-d8cd02b5b5893df382c08566087e32fe5b0c3abb.zip
FreeBSD-src-d8cd02b5b5893df382c08566087e32fe5b0c3abb.tar.gz
Import ACPICA 20121018.
Diffstat (limited to 'source/components/parser')
-rw-r--r--source/components/parser/psargs.c8
-rw-r--r--source/components/parser/psloop.c44
-rw-r--r--source/components/parser/psopcode.c6
-rw-r--r--source/components/parser/psparse.c14
-rw-r--r--source/components/parser/psscope.c1
-rw-r--r--source/components/parser/pstree.c2
-rw-r--r--source/components/parser/psutils.c5
-rw-r--r--source/components/parser/psxface.c2
8 files changed, 50 insertions, 32 deletions
diff --git a/source/components/parser/psargs.c b/source/components/parser/psargs.c
index 8140fdb..74d0cc8 100644
--- a/source/components/parser/psargs.c
+++ b/source/components/parser/psargs.c
@@ -131,7 +131,7 @@ AcpiPsGetNextPackageLength (
* RETURN: Pointer to end-of-package +1
*
* DESCRIPTION: Get next package length and return a pointer past the end of
- * the package. Consumes the package length field
+ * the package. Consumes the package length field
*
******************************************************************************/
@@ -163,8 +163,8 @@ AcpiPsGetNextPackageEnd (
* RETURN: Pointer to the start of the name string (pointer points into
* the AML.
*
- * DESCRIPTION: Get next raw namestring within the AML stream. Handles all name
- * prefix characters. Set parser state to point past the string.
+ * DESCRIPTION: Get next raw namestring within the AML stream. Handles all name
+ * prefix characters. Set parser state to point past the string.
* (Name is consumed from the AML.)
*
******************************************************************************/
@@ -244,7 +244,7 @@ AcpiPsGetNextNamestring (
*
* DESCRIPTION: Get next name (if method call, return # of required args).
* Names are looked up in the internal namespace to determine
- * if the name represents a control method. If a method
+ * if the name represents a control method. If a method
* is found, the number of arguments to the method is returned.
* This information is critical for parsing to continue correctly.
*
diff --git a/source/components/parser/psloop.c b/source/components/parser/psloop.c
index d578c7e3..e63dd04 100644
--- a/source/components/parser/psloop.c
+++ b/source/components/parser/psloop.c
@@ -153,17 +153,44 @@ AcpiPsGetAmlOpcode (
case AML_CLASS_UNKNOWN:
- /* The opcode is unrecognized. Just skip unknown opcodes */
+ /* The opcode is unrecognized. Complain and skip unknown opcodes */
- ACPI_ERROR ((AE_INFO,
- "Found unknown opcode 0x%X at AML address %p offset 0x%X, ignoring",
- WalkState->Opcode, WalkState->ParserState.Aml, WalkState->AmlOffset));
+ if (WalkState->PassNumber == 2)
+ {
+ ACPI_ERROR ((AE_INFO,
+ "Unknown opcode 0x%.2X at table offset 0x%.4X, ignoring",
+ WalkState->Opcode,
+ (UINT32) (WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER))));
+
+ ACPI_DUMP_BUFFER (WalkState->ParserState.Aml - 16, 48);
+
+#ifdef ACPI_ASL_COMPILER
+ /*
+ * This is executed for the disassembler only. Output goes
+ * to the disassembled ASL output file.
+ */
+ AcpiOsPrintf (
+ "/*\nError: Unknown opcode 0x%.2X at table offset 0x%.4X, context:\n",
+ WalkState->Opcode,
+ (UINT32) (WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER)));
+
+ /* Dump the context surrounding the invalid opcode */
- ACPI_DUMP_BUFFER (WalkState->ParserState.Aml, 128);
+ AcpiUtDumpBuffer (((UINT8 *) WalkState->ParserState.Aml - 16),
+ 48, DB_BYTE_DISPLAY,
+ WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER) - 16);
+ AcpiOsPrintf (" */\n");
+#endif
+ }
- /* Assume one-byte bad opcode */
+ /* Increment past one-byte or two-byte opcode */
WalkState->ParserState.Aml++;
+ if (WalkState->Opcode > 0xFF) /* Can only happen if first byte is 0x5B */
+ {
+ WalkState->ParserState.Aml++;
+ }
+
return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE);
default:
@@ -551,8 +578,8 @@ AcpiPsGetArguments (
(!Arg))
{
ACPI_WARNING ((AE_INFO,
- "Detected an unsupported executable opcode "
- "at module-level: [0x%.4X] at table offset 0x%.4X",
+ "Unsupported module-level executable opcode "
+ "0x%.2X at table offset 0x%.4X",
Op->Common.AmlOpcode,
(UINT32) (ACPI_PTR_DIFF (AmlOpStart,
WalkState->ParserState.AmlStart) +
@@ -1265,4 +1292,3 @@ AcpiPsParseLoop (
Status = AcpiPsCompleteFinalOp (WalkState, Op, Status);
return_ACPI_STATUS (Status);
}
-
diff --git a/source/components/parser/psopcode.c b/source/components/parser/psopcode.c
index ef2257e..139c934 100644
--- a/source/components/parser/psopcode.c
+++ b/source/components/parser/psopcode.c
@@ -62,7 +62,7 @@ static const UINT8 AcpiGbl_ArgumentCount[] = {0,1,1,1,1,2,2,2,2,3,3,6};
*
* DESCRIPTION: Opcode table. Each entry contains <opcode, type, name, operands>
* The name is a simple ascii string, the operand specifier is an
- * ascii string with one letter per operand. The letter specifies
+ * ascii string with one letter per operand. The letter specifies
* the operand type.
*
******************************************************************************/
@@ -187,7 +187,7 @@ static const UINT8 AcpiGbl_ArgumentCount[] = {0,1,1,1,1,2,2,2,2,3,3,6};
/*
- * Master Opcode information table. A summary of everything we know about each
+ * Master Opcode information table. A summary of everything we know about each
* opcode, all in one place.
*/
const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] =
@@ -387,7 +387,7 @@ static const UINT8 AcpiGbl_ShortOpIndex[256] =
/*
* This table is indexed by the second opcode of the extended opcode
- * pair. It returns an index into the opcode table (AcpiGbl_AmlOpInfo)
+ * pair. It returns an index into the opcode table (AcpiGbl_AmlOpInfo)
*/
static const UINT8 AcpiGbl_LongOpIndex[NUM_EXTENDED_OPCODE] =
{
diff --git a/source/components/parser/psparse.c b/source/components/parser/psparse.c
index bcf46ad..b85dac7 100644
--- a/source/components/parser/psparse.c
+++ b/source/components/parser/psparse.c
@@ -44,9 +44,9 @@
/*
* Parse the AML and build an operation tree as most interpreters,
- * like Perl, do. Parsing is done by hand rather than with a YACC
+ * like Perl, do. Parsing is done by hand rather than with a YACC
* generated parser to tightly constrain stack and dynamic memory
- * usage. At the same time, parsing is kept flexible and the code
+ * usage. At the same time, parsing is kept flexible and the code
* fairly compact by parsing based on a list of AML opcode
* templates in AmlOpInfo[]
*/
@@ -196,7 +196,7 @@ AcpiPsCompleteThisOp (
case AML_CLASS_CREATE:
/*
- * These opcodes contain TermArg operands. The current
+ * These opcodes contain TermArg operands. The current
* op must be replaced by a placeholder return op
*/
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP);
@@ -209,7 +209,7 @@ AcpiPsCompleteThisOp (
case AML_CLASS_NAMED_OBJECT:
/*
- * These opcodes contain TermArg operands. The current
+ * These opcodes contain TermArg operands. The current
* op must be replaced by a placeholder return op
*/
if ((Op->Common.Parent->Common.AmlOpcode == AML_REGION_OP) ||
@@ -394,7 +394,7 @@ AcpiPsNextParseState (
case AE_CTRL_FALSE:
/*
* Either an IF/WHILE Predicate was false or we encountered a BREAK
- * opcode. In both cases, we do not execute the rest of the
+ * opcode. In both cases, we do not execute the rest of the
* package; We simply close out the parent (finishing the walk of
* this branch of the tree) and continue execution at the parent
* level.
@@ -508,7 +508,7 @@ AcpiPsParseAml (
AcpiGbl_CurrentWalkList = Thread;
/*
- * Execute the walk loop as long as there is a valid Walk State. This
+ * Execute the walk loop as long as there is a valid Walk State. This
* handles nested control method invocations without recursion.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "State=%p\n", WalkState));
@@ -707,5 +707,3 @@ AcpiPsParseAml (
AcpiGbl_CurrentWalkList = PrevWalkList;
return_ACPI_STATUS (Status);
}
-
-
diff --git a/source/components/parser/psscope.c b/source/components/parser/psscope.c
index 1df5a33..359f350 100644
--- a/source/components/parser/psscope.c
+++ b/source/components/parser/psscope.c
@@ -299,4 +299,3 @@ AcpiPsCleanupScope (
return_VOID;
}
-
diff --git a/source/components/parser/pstree.c b/source/components/parser/pstree.c
index 8271314..36771b7 100644
--- a/source/components/parser/pstree.c
+++ b/source/components/parser/pstree.c
@@ -356,5 +356,3 @@ AcpiPsGetChild (
return (Child);
}
#endif
-
-
diff --git a/source/components/parser/psutils.c b/source/components/parser/psutils.c
index e28b75c..c72173f 100644
--- a/source/components/parser/psutils.c
+++ b/source/components/parser/psutils.c
@@ -120,7 +120,7 @@ AcpiPsInitOp (
* RETURN: Pointer to the new Op, null on failure
*
* DESCRIPTION: Allocate an acpi_op, choose op type (and thus size) based on
- * opcode. A cache of opcodes is available for the pure
+ * opcode. A cache of opcodes is available for the pure
* GENERIC_OP, since this is by far the most commonly used.
*
******************************************************************************/
@@ -189,7 +189,7 @@ AcpiPsAllocOp (
*
* RETURN: None.
*
- * DESCRIPTION: Free an Op object. Either put it on the GENERIC_OP cache list
+ * DESCRIPTION: Free an Op object. Either put it on the GENERIC_OP cache list
* or actually free it.
*
******************************************************************************/
@@ -287,4 +287,3 @@ AcpiPsSetName (
Op->Named.Name = name;
}
-
diff --git a/source/components/parser/psxface.c b/source/components/parser/psxface.c
index a9ceb6d..f8af99e 100644
--- a/source/components/parser/psxface.c
+++ b/source/components/parser/psxface.c
@@ -438,5 +438,3 @@ AcpiPsUpdateParameterList (
}
}
}
-
-
OpenPOWER on IntegriCloud