summaryrefslogtreecommitdiff
path: root/source/components/dispatcher/dswload.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/dispatcher/dswload.c')
-rw-r--r--source/components/dispatcher/dswload.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/source/components/dispatcher/dswload.c b/source/components/dispatcher/dswload.c
index f3f99ea1b914..8793c0ed1cf5 100644
--- a/source/components/dispatcher/dswload.c
+++ b/source/components/dispatcher/dswload.c
@@ -518,7 +518,7 @@ AcpiDsLoad1BeginOp (
/* Initialize the op */
#if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY))
- Op->Named.Path = ACPI_CAST_PTR (UINT8, Path);
+ Op->Named.Path = Path;
#endif
if (Node)
@@ -558,6 +558,10 @@ AcpiDsLoad1EndOp (
ACPI_OBJECT_TYPE ObjectType;
ACPI_STATUS Status = AE_OK;
+#ifdef ACPI_ASL_COMPILER
+ UINT8 ParamCount;
+#endif
+
ACPI_FUNCTION_TRACE (DsLoad1EndOp);
@@ -642,6 +646,37 @@ AcpiDsLoad1EndOp (
}
}
+#ifdef ACPI_ASL_COMPILER
+ /*
+ * For external opcode, get the object type from the argument and
+ * get the parameter count from the argument's next.
+ */
+ if (AcpiGbl_DisasmFlag &&
+ Op->Common.Node &&
+ Op->Common.AmlOpcode == AML_EXTERNAL_OP)
+ {
+ /*
+ * Note, if this external is not a method
+ * Op->Common.Value.Arg->Common.Next->Common.Value.Integer == 0
+ * Therefore, ParamCount will be 0.
+ */
+ ParamCount = (UINT8) Op->Common.Value.Arg->Common.Next->Common.Value.Integer;
+ ObjectType = (UINT8) Op->Common.Value.Arg->Common.Value.Integer;
+ Op->Common.Node->Flags |= ANOBJ_IS_EXTERNAL;
+ Op->Common.Node->Type = (UINT8) ObjectType;
+
+ AcpiDmCreateSubobjectForExternal ((UINT8)ObjectType,
+ &Op->Common.Node, ParamCount);
+
+ /*
+ * Add the external to the external list because we may be
+ * emitting code based off of the items within the external list.
+ */
+ AcpiDmAddOpToExternalList (Op, Op->Named.Path, (UINT8)ObjectType, ParamCount,
+ ACPI_EXT_ORIGIN_FROM_OPCODE | ACPI_EXT_RESOLVED_REFERENCE);
+ }
+#endif
+
/*
* If we are executing a method, do not create any namespace objects
* during the load phase, only during execution.
@@ -689,6 +724,7 @@ AcpiDsLoad1EndOp (
/* Pop the scope stack (only if loading a table) */
if (!WalkState->MethodNode &&
+ Op->Common.AmlOpcode != AML_EXTERNAL_OP &&
AcpiNsOpensScope (ObjectType))
{
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s): Popping scope for Op %p\n",