summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/components/parser
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/components/parser')
-rw-r--r--sys/contrib/dev/acpica/components/parser/psargs.c45
-rw-r--r--sys/contrib/dev/acpica/components/parser/psloop.c40
-rw-r--r--sys/contrib/dev/acpica/components/parser/psobject.c23
-rw-r--r--sys/contrib/dev/acpica/components/parser/psopcode.c4
-rw-r--r--sys/contrib/dev/acpica/components/parser/psopinfo.c4
-rw-r--r--sys/contrib/dev/acpica/components/parser/psparse.c49
-rw-r--r--sys/contrib/dev/acpica/components/parser/psscope.c12
-rw-r--r--sys/contrib/dev/acpica/components/parser/pstree.c2
-rw-r--r--sys/contrib/dev/acpica/components/parser/psutils.c22
-rw-r--r--sys/contrib/dev/acpica/components/parser/pswalk.c3
-rw-r--r--sys/contrib/dev/acpica/components/parser/psxface.c156
11 files changed, 129 insertions, 231 deletions
diff --git a/sys/contrib/dev/acpica/components/parser/psargs.c b/sys/contrib/dev/acpica/components/parser/psargs.c
index b2a86fe..9c49ea6 100644
--- a/sys/contrib/dev/acpica/components/parser/psargs.c
+++ b/sys/contrib/dev/acpica/components/parser/psargs.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -287,8 +287,8 @@ AcpiPsGetNextNamepath (
* the upsearch)
*/
Status = AcpiNsLookup (WalkState->ScopeInfo, Path,
- ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
- ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node);
+ ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+ ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node);
/*
* If this name is a control method invocation, we must
@@ -316,7 +316,7 @@ AcpiPsGetNextNamepath (
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"Control Method - %p Desc %p Path=%p\n", Node, MethodDesc, Path));
- NameOp = AcpiPsAllocOp (AML_INT_NAMEPATH_OP);
+ NameOp = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, Start);
if (!NameOp)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@@ -359,7 +359,7 @@ AcpiPsGetNextNamepath (
/* 1) NotFound is ok during load pass 1/2 (allow forward references) */
if ((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) !=
- ACPI_PARSE_EXECUTE)
+ ACPI_PARSE_EXECUTE)
{
Status = AE_OK;
}
@@ -391,7 +391,7 @@ AcpiPsGetNextNamepath (
ACPI_ERROR_NAMESPACE (Path, Status);
if ((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) ==
- ACPI_PARSE_EXECUTE)
+ ACPI_PARSE_EXECUTE)
{
/* Report a control method execution error */
@@ -524,7 +524,7 @@ static ACPI_PARSE_OBJECT *
AcpiPsGetNextField (
ACPI_PARSE_STATE *ParserState)
{
- UINT32 AmlOffset;
+ UINT8 *Aml;
ACPI_PARSE_OBJECT *Field;
ACPI_PARSE_OBJECT *Arg = NULL;
UINT16 Opcode;
@@ -540,8 +540,7 @@ AcpiPsGetNextField (
ACPI_FUNCTION_TRACE (PsGetNextField);
- AmlOffset = (UINT32) ACPI_PTR_DIFF (
- ParserState->Aml, ParserState->AmlStart);
+ Aml = ParserState->Aml;
/* Determine field type */
@@ -579,14 +578,12 @@ AcpiPsGetNextField (
/* Allocate a new field op */
- Field = AcpiPsAllocOp (Opcode);
+ Field = AcpiPsAllocOp (Opcode, Aml);
if (!Field)
{
return_PTR (NULL);
}
- Field->Common.AmlOffset = AmlOffset;
-
/* Decode the field type */
switch (Opcode)
@@ -650,6 +647,7 @@ AcpiPsGetNextField (
* Argument for Connection operator can be either a Buffer
* (resource descriptor), or a NameString.
*/
+ Aml = ParserState->Aml;
if (ACPI_GET8 (ParserState->Aml) == AML_BUFFER_OP)
{
ParserState->Aml++;
@@ -662,7 +660,7 @@ AcpiPsGetNextField (
{
/* Non-empty list */
- Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP);
+ Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP, Aml);
if (!Arg)
{
AcpiPsFreeOp (Field);
@@ -712,7 +710,7 @@ AcpiPsGetNextField (
}
else
{
- Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP);
+ Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, Aml);
if (!Arg)
{
AcpiPsFreeOp (Field);
@@ -784,11 +782,12 @@ AcpiPsGetNextArg (
/* Constants, strings, and namestrings are all the same size */
- Arg = AcpiPsAllocOp (AML_BYTE_OP);
+ Arg = AcpiPsAllocOp (AML_BYTE_OP, ParserState->Aml);
if (!Arg)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
+
AcpiPsGetNextSimpleArg (ParserState, ArgType, Arg);
break;
@@ -836,7 +835,8 @@ AcpiPsGetNextArg (
{
/* Non-empty list */
- Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP);
+ Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP,
+ ParserState->Aml);
if (!Arg)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@@ -857,6 +857,7 @@ AcpiPsGetNextArg (
case ARGP_TARGET:
case ARGP_SUPERNAME:
case ARGP_SIMPLENAME:
+ case ARGP_NAME_OR_REF:
Subop = AcpiPsPeekOpcode (ParserState);
if (Subop == 0 ||
@@ -866,7 +867,7 @@ AcpiPsGetNextArg (
{
/* NullName or NameString */
- Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP);
+ Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, ParserState->Aml);
if (!Arg)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@@ -876,11 +877,12 @@ AcpiPsGetNextArg (
if (WalkState->Opcode == AML_UNLOAD_OP)
{
- Status = AcpiPsGetNextNamepath (WalkState, ParserState, Arg, 1);
+ Status = AcpiPsGetNextNamepath (WalkState, ParserState,
+ Arg, ACPI_POSSIBLE_METHOD_CALL);
/*
- * If the SuperName arg of Unload is a method call,
- * we have restored the AML pointer, just free this Arg
+ * If the SuperName argument is a method call, we have
+ * already restored the AML pointer, just free this Arg
*/
if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP)
{
@@ -890,7 +892,8 @@ AcpiPsGetNextArg (
}
else
{
- Status = AcpiPsGetNextNamepath (WalkState, ParserState, Arg, 0);
+ Status = AcpiPsGetNextNamepath (WalkState, ParserState,
+ Arg, ACPI_NOT_METHOD_CALL);
}
}
else
diff --git a/sys/contrib/dev/acpica/components/parser/psloop.c b/sys/contrib/dev/acpica/components/parser/psloop.c
index 63b64ab..cbcca10 100644
--- a/sys/contrib/dev/acpica/components/parser/psloop.c
+++ b/sys/contrib/dev/acpica/components/parser/psloop.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,7 @@
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acinterp.h>
#include <contrib/dev/acpica/include/acparser.h>
#include <contrib/dev/acpica/include/acdispat.h>
#include <contrib/dev/acpica/include/amlcode.h>
@@ -119,7 +120,8 @@ AcpiPsGetArguments (
case AML_INT_NAMEPATH_OP: /* AML_NAMESTRING_ARG */
- Status = AcpiPsGetNextNamepath (WalkState, &(WalkState->ParserState), Op, 1);
+ Status = AcpiPsGetNextNamepath (WalkState,
+ &(WalkState->ParserState), Op, ACPI_POSSIBLE_METHOD_CALL);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -132,13 +134,13 @@ AcpiPsGetArguments (
/*
* Op is not a constant or string, append each argument to the Op
*/
- while (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) && !WalkState->ArgCount)
+ while (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) &&
+ !WalkState->ArgCount)
{
- WalkState->AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->ParserState.Aml,
- WalkState->ParserState.AmlStart);
+ WalkState->Aml = WalkState->ParserState.Aml;
Status = AcpiPsGetNextArg (WalkState, &(WalkState->ParserState),
- GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg);
+ GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -146,7 +148,6 @@ AcpiPsGetArguments (
if (Arg)
{
- Arg->Common.AmlOffset = WalkState->AmlOffset;
AcpiPsAppendArg (Op, Arg);
}
@@ -319,6 +320,9 @@ AcpiPsLinkModuleCode (
ACPI_NAMESPACE_NODE *ParentNode;
+ ACPI_FUNCTION_TRACE (PsLinkModuleCode);
+
+
/* Get the tail of the list */
Prev = Next = AcpiGbl_ModuleCodeList;
@@ -340,9 +344,12 @@ AcpiPsLinkModuleCode (
MethodObj = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
if (!MethodObj)
{
- return;
+ return_VOID;
}
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
+ "Create/Link new code block: %p\n", MethodObj));
+
if (ParentOp->Common.Node)
{
ParentNode = ParentOp->Common.Node;
@@ -375,8 +382,13 @@ AcpiPsLinkModuleCode (
}
else
{
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
+ "Appending to existing code block: %p\n", Prev));
+
Prev->Method.AmlLength += AmlLength;
}
+
+ return_VOID;
}
/*******************************************************************************
@@ -502,15 +514,7 @@ AcpiPsParseLoop (
continue;
}
- Op->Common.AmlOffset = WalkState->AmlOffset;
-
- if (WalkState->OpInfo)
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
- "Opcode %4.4X [%s] Op %p Aml %p AmlOffset %5.5X\n",
- (UINT32) Op->Common.AmlOpcode, WalkState->OpInfo->Name,
- Op, ParserState->Aml, Op->Common.AmlOffset));
- }
+ AcpiExStartTraceOpcode (Op, WalkState);
}
@@ -548,7 +552,7 @@ AcpiPsParseLoop (
* prepare for argument
*/
Status = AcpiPsPushScope (ParserState, Op,
- WalkState->ArgTypes, WalkState->ArgCount);
+ WalkState->ArgTypes, WalkState->ArgCount);
if (ACPI_FAILURE (Status))
{
Status = AcpiPsCompleteOp (WalkState, &Op, Status);
diff --git a/sys/contrib/dev/acpica/components/parser/psobject.c b/sys/contrib/dev/acpica/components/parser/psobject.c
index 0ad37b9..3b94e2c 100644
--- a/sys/contrib/dev/acpica/components/parser/psobject.c
+++ b/sys/contrib/dev/acpica/components/parser/psobject.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -73,12 +73,13 @@ static ACPI_STATUS
AcpiPsGetAmlOpcode (
ACPI_WALK_STATE *WalkState)
{
+ UINT32 AmlOffset;
+
ACPI_FUNCTION_TRACE_PTR (PsGetAmlOpcode, WalkState);
- WalkState->AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->ParserState.Aml,
- WalkState->ParserState.AmlStart);
+ WalkState->Aml = WalkState->ParserState.Aml;
WalkState->Opcode = AcpiPsPeekOpcode (&(WalkState->ParserState));
/*
@@ -107,10 +108,13 @@ AcpiPsGetAmlOpcode (
if (WalkState->PassNumber == 2)
{
+ AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml,
+ WalkState->ParserState.AmlStart);
+
ACPI_ERROR ((AE_INFO,
"Unknown opcode 0x%.2X at table offset 0x%.4X, ignoring",
WalkState->Opcode,
- (UINT32) (WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER))));
+ (UINT32) (AmlOffset + sizeof (ACPI_TABLE_HEADER))));
ACPI_DUMP_BUFFER ((WalkState->ParserState.Aml - 16), 48);
@@ -122,13 +126,13 @@ AcpiPsGetAmlOpcode (
AcpiOsPrintf (
"/*\nError: Unknown opcode 0x%.2X at table offset 0x%.4X, context:\n",
WalkState->Opcode,
- (UINT32) (WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER)));
+ (UINT32) (AmlOffset + sizeof (ACPI_TABLE_HEADER)));
/* Dump the context surrounding the invalid opcode */
AcpiUtDumpBuffer (((UINT8 *) WalkState->ParserState.Aml - 16),
48, DB_BYTE_DISPLAY,
- (WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER) - 16));
+ (AmlOffset + sizeof (ACPI_TABLE_HEADER) - 16));
AcpiOsPrintf (" */\n");
#endif
}
@@ -147,7 +151,8 @@ AcpiPsGetAmlOpcode (
/* Found opcode info, this is a normal opcode */
- WalkState->ParserState.Aml += AcpiPsGetOpcodeSize (WalkState->Opcode);
+ WalkState->ParserState.Aml +=
+ AcpiPsGetOpcodeSize (WalkState->Opcode);
WalkState->ArgTypes = WalkState->OpInfo->ParseArgs;
break;
}
@@ -197,7 +202,7 @@ AcpiPsBuildNamedOp (
(GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) != ARGP_NAME))
{
Status = AcpiPsGetNextArg (WalkState, &(WalkState->ParserState),
- GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg);
+ GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -313,7 +318,7 @@ AcpiPsCreateOp (
/* Create Op structure and append to parent's argument list */
WalkState->OpInfo = AcpiPsGetOpcodeInfo (WalkState->Opcode);
- Op = AcpiPsAllocOp (WalkState->Opcode);
+ Op = AcpiPsAllocOp (WalkState->Opcode, AmlOpStart);
if (!Op)
{
return_ACPI_STATUS (AE_NO_MEMORY);
diff --git a/sys/contrib/dev/acpica/components/parser/psopcode.c b/sys/contrib/dev/acpica/components/parser/psopcode.c
index e351e4c..9f53d1e 100644
--- a/sys/contrib/dev/acpica/components/parser/psopcode.c
+++ b/sys/contrib/dev/acpica/components/parser/psopcode.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -245,7 +245,7 @@ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] =
/* 34 */ ACPI_OP ("CreateWordField", ARGP_CREATE_WORD_FIELD_OP, ARGI_CREATE_WORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
/* 35 */ ACPI_OP ("CreateByteField", ARGP_CREATE_BYTE_FIELD_OP, ARGI_CREATE_BYTE_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
/* 36 */ ACPI_OP ("CreateBitField", ARGP_CREATE_BIT_FIELD_OP, ARGI_CREATE_BIT_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
-/* 37 */ ACPI_OP ("ObjectType", ARGP_TYPE_OP, ARGI_TYPE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_NO_OPERAND_RESOLVE),
+/* 37 */ ACPI_OP ("ObjectType", ARGP_OBJECT_TYPE_OP, ARGI_OBJECT_TYPE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_NO_OPERAND_RESOLVE),
/* 38 */ ACPI_OP ("LAnd", ARGP_LAND_OP, ARGI_LAND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL_NUMERIC | AML_CONSTANT),
/* 39 */ ACPI_OP ("LOr", ARGP_LOR_OP, ARGI_LOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL_NUMERIC | AML_CONSTANT),
/* 3A */ ACPI_OP ("LNot", ARGP_LNOT_OP, ARGI_LNOT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT),
diff --git a/sys/contrib/dev/acpica/components/parser/psopinfo.c b/sys/contrib/dev/acpica/components/parser/psopinfo.c
index f7f6248..6ffd7d2 100644
--- a/sys/contrib/dev/acpica/components/parser/psopinfo.c
+++ b/sys/contrib/dev/acpica/components/parser/psopinfo.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -165,7 +165,7 @@ AcpiPsGetOpcodeInfo (
*
******************************************************************************/
-char *
+const char *
AcpiPsGetOpcodeName (
UINT16 Opcode)
{
diff --git a/sys/contrib/dev/acpica/components/parser/psparse.c b/sys/contrib/dev/acpica/components/parser/psparse.c
index aa978cc..caf2a0e 100644
--- a/sys/contrib/dev/acpica/components/parser/psparse.c
+++ b/sys/contrib/dev/acpica/components/parser/psparse.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -161,6 +161,8 @@ AcpiPsCompleteThisOp (
return_ACPI_STATUS (AE_OK); /* OK for now */
}
+ AcpiExStopTraceOpcode (Op, WalkState);
+
/* Delete this op and the subtree below it if asked to */
if (((WalkState->ParseFlags & ACPI_PARSE_TREE_MASK) != ACPI_PARSE_DELETE_TREE) ||
@@ -198,7 +200,8 @@ AcpiPsCompleteThisOp (
* These opcodes contain TermArg operands. The current
* op must be replaced by a placeholder return op
*/
- ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP);
+ ReplacementOp = AcpiPsAllocOp (
+ AML_INT_RETURN_VALUE_OP, Op->Common.Aml);
if (!ReplacementOp)
{
Status = AE_NO_MEMORY;
@@ -217,7 +220,8 @@ AcpiPsCompleteThisOp (
(Op->Common.Parent->Common.AmlOpcode == AML_BANK_FIELD_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
{
- ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP);
+ ReplacementOp = AcpiPsAllocOp (
+ AML_INT_RETURN_VALUE_OP, Op->Common.Aml);
if (!ReplacementOp)
{
Status = AE_NO_MEMORY;
@@ -230,7 +234,8 @@ AcpiPsCompleteThisOp (
(Op->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
{
- ReplacementOp = AcpiPsAllocOp (Op->Common.AmlOpcode);
+ ReplacementOp = AcpiPsAllocOp (Op->Common.AmlOpcode,
+ Op->Common.Aml);
if (!ReplacementOp)
{
Status = AE_NO_MEMORY;
@@ -246,7 +251,8 @@ AcpiPsCompleteThisOp (
default:
- ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP);
+ ReplacementOp = AcpiPsAllocOp (
+ AML_INT_RETURN_VALUE_OP, Op->Common.Aml);
if (!ReplacementOp)
{
Status = AE_NO_MEMORY;
@@ -261,11 +267,11 @@ AcpiPsCompleteThisOp (
if (ReplacementOp)
{
- ReplacementOp->Common.Parent = Op->Common.Parent;
- ReplacementOp->Common.Value.Arg = NULL;
- ReplacementOp->Common.Node = Op->Common.Node;
+ ReplacementOp->Common.Parent = Op->Common.Parent;
+ ReplacementOp->Common.Value.Arg = NULL;
+ ReplacementOp->Common.Node = Op->Common.Node;
Op->Common.Parent->Common.Value.Arg = ReplacementOp;
- ReplacementOp->Common.Next = Op->Common.Next;
+ ReplacementOp->Common.Next = Op->Common.Next;
}
else
{
@@ -284,11 +290,11 @@ AcpiPsCompleteThisOp (
{
if (ReplacementOp)
{
- ReplacementOp->Common.Parent = Op->Common.Parent;
+ ReplacementOp->Common.Parent = Op->Common.Parent;
ReplacementOp->Common.Value.Arg = NULL;
- ReplacementOp->Common.Node = Op->Common.Node;
- Prev->Common.Next = ReplacementOp;
- ReplacementOp->Common.Next = Op->Common.Next;
+ ReplacementOp->Common.Node = Op->Common.Node;
+ Prev->Common.Next = ReplacementOp;
+ ReplacementOp->Common.Next = Op->Common.Next;
Next = NULL;
}
else
@@ -488,7 +494,8 @@ AcpiPsParseAml (
*/
if (WalkState->MethodDesc)
{
- WalkState->Thread->CurrentSyncLevel = WalkState->MethodDesc->Method.SyncLevel;
+ WalkState->Thread->CurrentSyncLevel =
+ WalkState->MethodDesc->Method.SyncLevel;
}
AcpiDsPushWalkState (WalkState, Thread);
@@ -534,8 +541,8 @@ AcpiPsParseAml (
}
/*
- * If the transfer to the new method method call worked, a new walk
- * state was created -- get it
+ * If the transfer to the new method method call worked
+ *, a new walk state was created -- get it
*/
WalkState = AcpiDsGetCurrentWalkState (Thread);
continue;
@@ -554,7 +561,8 @@ AcpiPsParseAml (
/* Check for possible multi-thread reentrancy problem */
if ((Status == AE_ALREADY_EXISTS) &&
- (!(WalkState->MethodDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)))
+ (!(WalkState->MethodDesc->Method.InfoFlags &
+ ACPI_METHOD_SERIALIZED)))
{
/*
* Method is not serialized and tried to create an object
@@ -580,7 +588,8 @@ AcpiPsParseAml (
* encountered an error during the method parse phase, there's lots of
* cleanup to do
*/
- if (((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) == ACPI_PARSE_EXECUTE) ||
+ if (((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) ==
+ ACPI_PARSE_EXECUTE) ||
(ACPI_FAILURE (Status)))
{
AcpiDsTerminateControlMethod (WalkState->MethodDesc, WalkState);
@@ -627,7 +636,7 @@ AcpiPsParseAml (
/* Restart the calling control method */
Status = AcpiDsRestartControlMethod (WalkState,
- PreviousWalkState->ImplicitReturnObj);
+ PreviousWalkState->ImplicitReturnObj);
}
else
{
@@ -638,7 +647,7 @@ AcpiPsParseAml (
AcpiDsClearImplicitReturn (PreviousWalkState);
Status = AcpiDsRestartControlMethod (WalkState,
- PreviousWalkState->ReturnDesc);
+ PreviousWalkState->ReturnDesc);
}
if (ACPI_SUCCESS (Status))
{
diff --git a/sys/contrib/dev/acpica/components/parser/psscope.c b/sys/contrib/dev/acpica/components/parser/psscope.c
index 87e897e..9ad7a58 100644
--- a/sys/contrib/dev/acpica/components/parser/psscope.c
+++ b/sys/contrib/dev/acpica/components/parser/psscope.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -236,9 +236,9 @@ AcpiPsPopScope (
/* Return to parsing previous op */
- *Op = Scope->ParseScope.Op;
- *ArgList = Scope->ParseScope.ArgList;
- *ArgCount = Scope->ParseScope.ArgCount;
+ *Op = Scope->ParseScope.Op;
+ *ArgList = Scope->ParseScope.ArgList;
+ *ArgCount = Scope->ParseScope.ArgCount;
ParserState->PkgEnd = Scope->ParseScope.PkgEnd;
/* All done with this scope state structure */
@@ -249,8 +249,8 @@ AcpiPsPopScope (
{
/* Empty parse stack, prepare to fetch next opcode */
- *Op = NULL;
- *ArgList = 0;
+ *Op = NULL;
+ *ArgList = 0;
*ArgCount = 0;
}
diff --git a/sys/contrib/dev/acpica/components/parser/pstree.c b/sys/contrib/dev/acpica/components/parser/pstree.c
index daec8f3..dd2d5e0 100644
--- a/sys/contrib/dev/acpica/components/parser/pstree.c
+++ b/sys/contrib/dev/acpica/components/parser/pstree.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/parser/psutils.c b/sys/contrib/dev/acpica/components/parser/psutils.c
index 1a269a6..ca3830e 100644
--- a/sys/contrib/dev/acpica/components/parser/psutils.c
+++ b/sys/contrib/dev/acpica/components/parser/psutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -64,12 +64,12 @@
ACPI_PARSE_OBJECT *
AcpiPsCreateScopeOp (
- void)
+ UINT8 *Aml)
{
ACPI_PARSE_OBJECT *ScopeOp;
- ScopeOp = AcpiPsAllocOp (AML_SCOPE_OP);
+ ScopeOp = AcpiPsAllocOp (AML_SCOPE_OP, Aml);
if (!ScopeOp)
{
return (NULL);
@@ -104,9 +104,9 @@ AcpiPsInitOp (
Op->Common.DescriptorType = ACPI_DESC_TYPE_PARSER;
Op->Common.AmlOpcode = Opcode;
- ACPI_DISASM_ONLY_MEMBERS (ACPI_STRNCPY (Op->Common.AmlOpName,
- (AcpiPsGetOpcodeInfo (Opcode))->Name,
- sizeof (Op->Common.AmlOpName)));
+ ACPI_DISASM_ONLY_MEMBERS (strncpy (Op->Common.AmlOpName,
+ (AcpiPsGetOpcodeInfo (Opcode))->Name,
+ sizeof (Op->Common.AmlOpName)));
}
@@ -115,6 +115,7 @@ AcpiPsInitOp (
* FUNCTION: AcpiPsAllocOp
*
* PARAMETERS: Opcode - Opcode that will be stored in the new Op
+ * Aml - Address of the opcode
*
* RETURN: Pointer to the new Op, null on failure
*
@@ -126,7 +127,8 @@ AcpiPsInitOp (
ACPI_PARSE_OBJECT*
AcpiPsAllocOp (
- UINT16 Opcode)
+ UINT16 Opcode,
+ UINT8 *Aml)
{
ACPI_PARSE_OBJECT *Op;
const ACPI_OPCODE_INFO *OpInfo;
@@ -146,7 +148,7 @@ AcpiPsAllocOp (
}
else if (OpInfo->Flags & AML_NAMED)
{
- Flags = ACPI_PARSEOP_NAMED;
+ Flags = ACPI_PARSEOP_NAMED_OBJECT;
}
else if (Opcode == AML_INT_BYTELIST_OP)
{
@@ -173,6 +175,7 @@ AcpiPsAllocOp (
if (Op)
{
AcpiPsInitOp (Op, Opcode);
+ Op->Common.Aml = Aml;
Op->Common.Flags = Flags;
}
@@ -202,7 +205,8 @@ AcpiPsFreeOp (
if (Op->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP)
{
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Free retval op: %p\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "Free retval op: %p\n", Op));
}
if (Op->Common.Flags & ACPI_PARSEOP_GENERIC)
diff --git a/sys/contrib/dev/acpica/components/parser/pswalk.c b/sys/contrib/dev/acpica/components/parser/pswalk.c
index 044b068..1a9e55e 100644
--- a/sys/contrib/dev/acpica/components/parser/pswalk.c
+++ b/sys/contrib/dev/acpica/components/parser/pswalk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -106,6 +106,7 @@ AcpiPsDeleteParseTree (
{
return_VOID;
}
+
if (Next)
{
Op = Next;
diff --git a/sys/contrib/dev/acpica/components/parser/psxface.c b/sys/contrib/dev/acpica/components/parser/psxface.c
index 2927f4c..b99cee0 100644
--- a/sys/contrib/dev/acpica/components/parser/psxface.c
+++ b/sys/contrib/dev/acpica/components/parser/psxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -47,6 +47,7 @@
#include <contrib/dev/acpica/include/acdispat.h>
#include <contrib/dev/acpica/include/acinterp.h>
#include <contrib/dev/acpica/include/actables.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
#define _COMPONENT ACPI_PARSER
@@ -55,14 +56,6 @@
/* Local Prototypes */
static void
-AcpiPsStartTrace (
- ACPI_EVALUATE_INFO *Info);
-
-static void
-AcpiPsStopTrace (
- ACPI_EVALUATE_INFO *Info);
-
-static void
AcpiPsUpdateParameterList (
ACPI_EVALUATE_INFO *Info,
UINT16 Action);
@@ -86,7 +79,7 @@ AcpiPsUpdateParameterList (
ACPI_STATUS
AcpiDebugTrace (
- char *Name,
+ const char *Name,
UINT32 DebugLevel,
UINT32 DebugLayer,
UINT32 Flags)
@@ -100,128 +93,14 @@ AcpiDebugTrace (
return (Status);
}
- /* TBDs: Validate name, allow full path or just nameseg */
-
- AcpiGbl_TraceMethodName = *ACPI_CAST_PTR (UINT32, Name);
+ AcpiGbl_TraceMethodName = Name;
AcpiGbl_TraceFlags = Flags;
-
- if (DebugLevel)
- {
- AcpiGbl_TraceDbgLevel = DebugLevel;
- }
- if (DebugLayer)
- {
- AcpiGbl_TraceDbgLayer = DebugLayer;
- }
+ AcpiGbl_TraceDbgLevel = DebugLevel;
+ AcpiGbl_TraceDbgLayer = DebugLayer;
+ Status = AE_OK;
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiPsStartTrace
- *
- * PARAMETERS: Info - Method info struct
- *
- * RETURN: None
- *
- * DESCRIPTION: Start control method execution trace
- *
- ******************************************************************************/
-
-static void
-AcpiPsStartTrace (
- ACPI_EVALUATE_INFO *Info)
-{
- ACPI_STATUS Status;
-
-
- ACPI_FUNCTION_ENTRY ();
-
-
- Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (Status))
- {
- return;
- }
-
- if ((!AcpiGbl_TraceMethodName) ||
- (AcpiGbl_TraceMethodName != Info->Node->Name.Integer))
- {
- goto Exit;
- }
-
- AcpiGbl_OriginalDbgLevel = AcpiDbgLevel;
- AcpiGbl_OriginalDbgLayer = AcpiDbgLayer;
-
- AcpiDbgLevel = 0x00FFFFFF;
- AcpiDbgLayer = ACPI_UINT32_MAX;
-
- if (AcpiGbl_TraceDbgLevel)
- {
- AcpiDbgLevel = AcpiGbl_TraceDbgLevel;
- }
- if (AcpiGbl_TraceDbgLayer)
- {
- AcpiDbgLayer = AcpiGbl_TraceDbgLayer;
- }
-
-
-Exit:
- (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiPsStopTrace
- *
- * PARAMETERS: Info - Method info struct
- *
- * RETURN: None
- *
- * DESCRIPTION: Stop control method execution trace
- *
- ******************************************************************************/
-
-static void
-AcpiPsStopTrace (
- ACPI_EVALUATE_INFO *Info)
-{
- ACPI_STATUS Status;
-
-
- ACPI_FUNCTION_ENTRY ();
-
-
- Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (Status))
- {
- return;
- }
-
- if ((!AcpiGbl_TraceMethodName) ||
- (AcpiGbl_TraceMethodName != Info->Node->Name.Integer))
- {
- goto Exit;
- }
-
- /* Disable further tracing if type is one-shot */
-
- if (AcpiGbl_TraceFlags & 1)
- {
- AcpiGbl_TraceMethodName = 0;
- AcpiGbl_TraceDbgLevel = 0;
- AcpiGbl_TraceDbgLayer = 0;
- }
-
- AcpiDbgLevel = AcpiGbl_OriginalDbgLevel;
- AcpiDbgLayer = AcpiGbl_OriginalDbgLayer;
-
-Exit:
- (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+ return (Status);
}
@@ -284,10 +163,6 @@ AcpiPsExecuteMethod (
*/
AcpiPsUpdateParameterList (Info, REF_INCREMENT);
- /* Begin tracing if requested */
-
- AcpiPsStartTrace (Info);
-
/*
* Execute the method. Performs parse simultaneously
*/
@@ -297,7 +172,7 @@ AcpiPsExecuteMethod (
/* Create and init a Root Node */
- Op = AcpiPsCreateScopeOp ();
+ Op = AcpiPsCreateScopeOp (Info->ObjDesc->Method.AmlStart);
if (!Op)
{
Status = AE_NO_MEMORY;
@@ -308,7 +183,7 @@ AcpiPsExecuteMethod (
Info->PassNumber = ACPI_IMODE_EXECUTE;
WalkState = AcpiDsCreateWalkState (
- Info->ObjDesc->Method.OwnerId, NULL, NULL, NULL);
+ Info->ObjDesc->Method.OwnerId, NULL, NULL, NULL);
if (!WalkState)
{
Status = AE_NO_MEMORY;
@@ -316,8 +191,8 @@ AcpiPsExecuteMethod (
}
Status = AcpiDsInitAmlWalk (WalkState, Op, Info->Node,
- Info->ObjDesc->Method.AmlStart,
- Info->ObjDesc->Method.AmlLength, Info, Info->PassNumber);
+ Info->ObjDesc->Method.AmlStart,
+ Info->ObjDesc->Method.AmlLength, Info, Info->PassNumber);
if (ACPI_FAILURE (Status))
{
AcpiDsDeleteWalkState (WalkState);
@@ -370,10 +245,6 @@ AcpiPsExecuteMethod (
Cleanup:
AcpiPsDeleteParseTree (Op);
- /* End optional tracing */
-
- AcpiPsStopTrace (Info);
-
/* Take away the extra reference that we gave the parameters above */
AcpiPsUpdateParameterList (Info, REF_DECREMENT);
@@ -432,7 +303,8 @@ AcpiPsUpdateParameterList (
{
/* Ignore errors, just do them all */
- (void) AcpiUtUpdateObjectReference (Info->Parameters[i], Action);
+ (void) AcpiUtUpdateObjectReference (
+ Info->Parameters[i], Action);
}
}
}
OpenPOWER on IntegriCloud