1 /******************************************************************************
3 * Module Name: dsobject - Dispatcher object management routines
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2017, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
44 #include <contrib/dev/acpica/include/acpi.h>
45 #include <contrib/dev/acpica/include/accommon.h>
46 #include <contrib/dev/acpica/include/acparser.h>
47 #include <contrib/dev/acpica/include/amlcode.h>
48 #include <contrib/dev/acpica/include/acdispat.h>
49 #include <contrib/dev/acpica/include/acnamesp.h>
50 #include <contrib/dev/acpica/include/acinterp.h>
52 #define _COMPONENT ACPI_DISPATCHER
53 ACPI_MODULE_NAME ("dsobject")
55 /* Local prototypes */
58 AcpiDsBuildInternalObject (
59 ACPI_WALK_STATE *WalkState,
60 ACPI_PARSE_OBJECT *Op,
61 ACPI_OPERAND_OBJECT **ObjDescPtr);
64 #ifndef ACPI_NO_METHOD_EXECUTION
65 /*******************************************************************************
67 * FUNCTION: AcpiDsBuildInternalObject
69 * PARAMETERS: WalkState - Current walk state
70 * Op - Parser object to be translated
71 * ObjDescPtr - Where the ACPI internal object is returned
75 * DESCRIPTION: Translate a parser Op object to the equivalent namespace object
76 * Simple objects are any objects other than a package object!
78 ******************************************************************************/
81 AcpiDsBuildInternalObject (
82 ACPI_WALK_STATE *WalkState,
83 ACPI_PARSE_OBJECT *Op,
84 ACPI_OPERAND_OBJECT **ObjDescPtr)
86 ACPI_OPERAND_OBJECT *ObjDesc;
88 ACPI_OBJECT_TYPE Type;
91 ACPI_FUNCTION_TRACE (DsBuildInternalObject);
95 if (Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
98 * This is a named object reference. If this name was
99 * previously looked up in the namespace, it was stored in this op.
100 * Otherwise, go ahead and look it up now
102 if (!Op->Common.Node)
104 Status = AcpiNsLookup (WalkState->ScopeInfo,
105 Op->Common.Value.String,
106 ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
107 ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
108 ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &(Op->Common.Node)));
109 if (ACPI_FAILURE (Status))
111 /* Check if we are resolving a named reference within a package */
113 if ((Status == AE_NOT_FOUND) && (AcpiGbl_EnableInterpreterSlack) &&
115 ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
116 (Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP)))
119 * We didn't find the target and we are populating elements
120 * of a package - ignore if slack enabled. Some ASL code
121 * contains dangling invalid references in packages and
122 * expects that no exception will be issued. Leave the
123 * element as a null element. It cannot be used, but it
124 * can be overwritten by subsequent ASL code - this is
125 * typically the case.
127 ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
128 "Ignoring unresolved reference in package [%4.4s]\n",
129 WalkState->ScopeInfo->Scope.Node->Name.Ascii));
131 return_ACPI_STATUS (AE_OK);
135 ACPI_ERROR_NAMESPACE (Op->Common.Value.String, Status);
138 return_ACPI_STATUS (Status);
142 /* Special object resolution for elements of a package */
144 if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
145 (Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
148 * Attempt to resolve the node to a value before we insert it into
149 * the package. If this is a reference to a common data type,
150 * resolve it immediately. According to the ACPI spec, package
151 * elements can only be "data objects" or method references.
152 * Attempt to resolve to an Integer, Buffer, String or Package.
153 * If cannot, return the named reference (for things like Devices,
154 * Methods, etc.) Buffer Fields and Fields will resolve to simple
155 * objects (int/buf/str/pkg).
157 * NOTE: References to things like Devices, Methods, Mutexes, etc.
158 * will remain as named references. This behavior is not described
159 * in the ACPI spec, but it appears to be an oversight.
161 ObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Op->Common.Node);
163 Status = AcpiExResolveNodeToValue (
164 ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc),
166 if (ACPI_FAILURE (Status))
168 return_ACPI_STATUS (Status);
172 * Special handling for Alias objects. We need to setup the type
173 * and the Op->Common.Node to point to the Alias target. Note,
174 * Alias has at most one level of indirection internally.
176 Type = Op->Common.Node->Type;
177 if (Type == ACPI_TYPE_LOCAL_ALIAS)
179 Type = ObjDesc->Common.Type;
180 Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
181 Op->Common.Node->Object);
187 * For these types, we need the actual node, not the subobject.
188 * However, the subobject did not get an extra reference count above.
190 * TBD: should ExResolveNodeToValue be changed to fix this?
192 case ACPI_TYPE_DEVICE:
193 case ACPI_TYPE_THERMAL:
195 AcpiUtAddReference (Op->Common.Node->Object);
197 /*lint -fallthrough */
199 * For these types, we need the actual node, not the subobject.
200 * The subobject got an extra reference count in ExResolveNodeToValue.
202 case ACPI_TYPE_MUTEX:
203 case ACPI_TYPE_METHOD:
204 case ACPI_TYPE_POWER:
205 case ACPI_TYPE_PROCESSOR:
206 case ACPI_TYPE_EVENT:
207 case ACPI_TYPE_REGION:
209 /* We will create a reference object for these types below */
214 * All other types - the node was resolved to an actual
215 * object, we are done.
222 /* Create and init a new internal ACPI object */
224 ObjDesc = AcpiUtCreateInternalObject (
225 (AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode))->ObjectType);
228 return_ACPI_STATUS (AE_NO_MEMORY);
231 Status = AcpiDsInitObjectFromOp (
232 WalkState, Op, Op->Common.AmlOpcode, &ObjDesc);
233 if (ACPI_FAILURE (Status))
235 AcpiUtRemoveReference (ObjDesc);
236 return_ACPI_STATUS (Status);
240 *ObjDescPtr = ObjDesc;
241 return_ACPI_STATUS (Status);
245 /*******************************************************************************
247 * FUNCTION: AcpiDsBuildInternalBufferObj
249 * PARAMETERS: WalkState - Current walk state
250 * Op - Parser object to be translated
251 * BufferLength - Length of the buffer
252 * ObjDescPtr - Where the ACPI internal object is returned
256 * DESCRIPTION: Translate a parser Op package object to the equivalent
259 ******************************************************************************/
262 AcpiDsBuildInternalBufferObj (
263 ACPI_WALK_STATE *WalkState,
264 ACPI_PARSE_OBJECT *Op,
266 ACPI_OPERAND_OBJECT **ObjDescPtr)
268 ACPI_PARSE_OBJECT *Arg;
269 ACPI_OPERAND_OBJECT *ObjDesc;
270 ACPI_PARSE_OBJECT *ByteList;
271 UINT32 ByteListLength = 0;
274 ACPI_FUNCTION_TRACE (DsBuildInternalBufferObj);
278 * If we are evaluating a Named buffer object "Name (xxxx, Buffer)".
279 * The buffer object already exists (from the NS node), otherwise it must
282 ObjDesc = *ObjDescPtr;
285 /* Create a new buffer object */
287 ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER);
288 *ObjDescPtr = ObjDesc;
291 return_ACPI_STATUS (AE_NO_MEMORY);
296 * Second arg is the buffer data (optional) ByteList can be either
297 * individual bytes or a string initializer. In either case, a
298 * ByteList appears in the AML.
300 Arg = Op->Common.Value.Arg; /* skip first arg */
302 ByteList = Arg->Named.Next;
305 if (ByteList->Common.AmlOpcode != AML_INT_BYTELIST_OP)
307 ACPI_ERROR ((AE_INFO,
308 "Expecting bytelist, found AML opcode 0x%X in op %p",
309 ByteList->Common.AmlOpcode, ByteList));
311 AcpiUtRemoveReference (ObjDesc);
315 ByteListLength = (UINT32) ByteList->Common.Value.Integer;
319 * The buffer length (number of bytes) will be the larger of:
320 * 1) The specified buffer length and
321 * 2) The length of the initializer byte list
323 ObjDesc->Buffer.Length = BufferLength;
324 if (ByteListLength > BufferLength)
326 ObjDesc->Buffer.Length = ByteListLength;
329 /* Allocate the buffer */
331 if (ObjDesc->Buffer.Length == 0)
333 ObjDesc->Buffer.Pointer = NULL;
334 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
335 "Buffer defined with zero length in AML, creating\n"));
339 ObjDesc->Buffer.Pointer =
340 ACPI_ALLOCATE_ZEROED (ObjDesc->Buffer.Length);
341 if (!ObjDesc->Buffer.Pointer)
343 AcpiUtDeleteObjectDesc (ObjDesc);
344 return_ACPI_STATUS (AE_NO_MEMORY);
347 /* Initialize buffer from the ByteList (if present) */
351 memcpy (ObjDesc->Buffer.Pointer, ByteList->Named.Data,
356 ObjDesc->Buffer.Flags |= AOPOBJ_DATA_VALID;
357 Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc);
358 return_ACPI_STATUS (AE_OK);
362 /*******************************************************************************
364 * FUNCTION: AcpiDsBuildInternalPackageObj
366 * PARAMETERS: WalkState - Current walk state
367 * Op - Parser object to be translated
368 * ElementCount - Number of elements in the package - this is
369 * the NumElements argument to Package()
370 * ObjDescPtr - Where the ACPI internal object is returned
374 * DESCRIPTION: Translate a parser Op package object to the equivalent
377 * NOTE: The number of elements in the package will be always be the NumElements
378 * count, regardless of the number of elements in the package list. If
379 * NumElements is smaller, only that many package list elements are used.
380 * if NumElements is larger, the Package object is padded out with
381 * objects of type Uninitialized (as per ACPI spec.)
383 * Even though the ASL compilers do not allow NumElements to be smaller
384 * than the Package list length (for the fixed length package opcode), some
385 * BIOS code modifies the AML on the fly to adjust the NumElements, and
386 * this code compensates for that. This also provides compatibility with
387 * other AML interpreters.
389 ******************************************************************************/
392 AcpiDsBuildInternalPackageObj (
393 ACPI_WALK_STATE *WalkState,
394 ACPI_PARSE_OBJECT *Op,
396 ACPI_OPERAND_OBJECT **ObjDescPtr)
398 ACPI_PARSE_OBJECT *Arg;
399 ACPI_PARSE_OBJECT *Parent;
400 ACPI_OPERAND_OBJECT *ObjDesc = NULL;
401 ACPI_STATUS Status = AE_OK;
404 UINT16 ReferenceCount;
407 ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj);
410 /* Find the parent of a possibly nested package */
412 Parent = Op->Common.Parent;
413 while ((Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
414 (Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
416 Parent = Parent->Common.Parent;
420 * If we are evaluating a Named package object "Name (xxxx, Package)",
421 * the package object already exists, otherwise it must be created.
423 ObjDesc = *ObjDescPtr;
426 ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE);
427 *ObjDescPtr = ObjDesc;
430 return_ACPI_STATUS (AE_NO_MEMORY);
433 ObjDesc->Package.Node = Parent->Common.Node;
437 * Allocate the element array (array of pointers to the individual
438 * objects) based on the NumElements parameter. Add an extra pointer slot
439 * so that the list is always null terminated.
441 ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED (
442 ((ACPI_SIZE) ElementCount + 1) * sizeof (void *));
444 if (!ObjDesc->Package.Elements)
446 AcpiUtDeleteObjectDesc (ObjDesc);
447 return_ACPI_STATUS (AE_NO_MEMORY);
450 ObjDesc->Package.Count = ElementCount;
453 * Initialize the elements of the package, up to the NumElements count.
454 * Package is automatically padded with uninitialized (NULL) elements
455 * if NumElements is greater than the package list length. Likewise,
456 * Package is truncated if NumElements is less than the list length.
458 Arg = Op->Common.Value.Arg;
459 Arg = Arg->Common.Next;
460 for (i = 0; Arg && (i < ElementCount); i++)
462 if (Arg->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP)
464 if (Arg->Common.Node->Type == ACPI_TYPE_METHOD)
467 * A method reference "looks" to the parser to be a method
468 * invocation, so we special case it here
470 Arg->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
471 Status = AcpiDsBuildInternalObject (
472 WalkState, Arg, &ObjDesc->Package.Elements[i]);
476 /* This package element is already built, just get it */
478 ObjDesc->Package.Elements[i] =
479 ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node);
484 Status = AcpiDsBuildInternalObject (
485 WalkState, Arg, &ObjDesc->Package.Elements[i]);
490 /* Existing package, get existing reference count */
492 ReferenceCount = (*ObjDescPtr)->Common.ReferenceCount;
493 if (ReferenceCount > 1)
495 /* Make new element ref count match original ref count */
497 for (Index = 0; Index < (ReferenceCount - 1); Index++)
499 AcpiUtAddReference ((ObjDesc->Package.Elements[i]));
504 Arg = Arg->Common.Next;
507 /* Check for match between NumElements and actual length of PackageList */
512 * NumElements was exhausted, but there are remaining elements in the
513 * PackageList. Truncate the package to NumElements.
515 * Note: technically, this is an error, from ACPI spec: "It is an error
516 * for NumElements to be less than the number of elements in the
517 * PackageList". However, we just print a message and
518 * no exception is returned. This provides Windows compatibility. Some
519 * BIOSs will alter the NumElements on the fly, creating this type
520 * of ill-formed package object.
525 * We must delete any package elements that were created earlier
526 * and are not going to be used because of the package truncation.
528 if (Arg->Common.Node)
530 AcpiUtRemoveReference (
531 ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node));
532 Arg->Common.Node = NULL;
535 /* Find out how many elements there really are */
538 Arg = Arg->Common.Next;
542 "Actual Package length (%u) is larger than "
543 "NumElements field (%u), truncated",
546 else if (i < ElementCount)
549 * Arg list (elements) was exhausted, but we did not reach NumElements count.
550 * Note: this is not an error, the package is padded out with NULLs.
552 ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
553 "Package List length (%u) smaller than NumElements "
554 "count (%u), padded with null elements\n",
558 ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
559 Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc);
560 return_ACPI_STATUS (Status);
564 /*******************************************************************************
566 * FUNCTION: AcpiDsCreateNode
568 * PARAMETERS: WalkState - Current walk state
569 * Node - NS Node to be initialized
570 * Op - Parser object to be translated
574 * DESCRIPTION: Create the object to be associated with a namespace node
576 ******************************************************************************/
580 ACPI_WALK_STATE *WalkState,
581 ACPI_NAMESPACE_NODE *Node,
582 ACPI_PARSE_OBJECT *Op)
585 ACPI_OPERAND_OBJECT *ObjDesc;
588 ACPI_FUNCTION_TRACE_PTR (DsCreateNode, Op);
592 * Because of the execution pass through the non-control-method
593 * parts of the table, we can arrive here twice. Only init
594 * the named object node the first time through
596 if (AcpiNsGetAttachedObject (Node))
598 return_ACPI_STATUS (AE_OK);
601 if (!Op->Common.Value.Arg)
603 /* No arguments, there is nothing to do */
605 return_ACPI_STATUS (AE_OK);
608 /* Build an internal object for the argument(s) */
610 Status = AcpiDsBuildInternalObject (
611 WalkState, Op->Common.Value.Arg, &ObjDesc);
612 if (ACPI_FAILURE (Status))
614 return_ACPI_STATUS (Status);
617 /* Re-type the object according to its argument */
619 Node->Type = ObjDesc->Common.Type;
621 /* Attach obj to node */
623 Status = AcpiNsAttachObject (Node, ObjDesc, Node->Type);
625 /* Remove local reference to the object */
627 AcpiUtRemoveReference (ObjDesc);
628 return_ACPI_STATUS (Status);
631 #endif /* ACPI_NO_METHOD_EXECUTION */
634 /*******************************************************************************
636 * FUNCTION: AcpiDsInitObjectFromOp
638 * PARAMETERS: WalkState - Current walk state
639 * Op - Parser op used to init the internal object
640 * Opcode - AML opcode associated with the object
641 * RetObjDesc - Namespace object to be initialized
645 * DESCRIPTION: Initialize a namespace object from a parser Op and its
646 * associated arguments. The namespace object is a more compact
647 * representation of the Op and its arguments.
649 ******************************************************************************/
652 AcpiDsInitObjectFromOp (
653 ACPI_WALK_STATE *WalkState,
654 ACPI_PARSE_OBJECT *Op,
656 ACPI_OPERAND_OBJECT **RetObjDesc)
658 const ACPI_OPCODE_INFO *OpInfo;
659 ACPI_OPERAND_OBJECT *ObjDesc;
660 ACPI_STATUS Status = AE_OK;
663 ACPI_FUNCTION_TRACE (DsInitObjectFromOp);
666 ObjDesc = *RetObjDesc;
667 OpInfo = AcpiPsGetOpcodeInfo (Opcode);
668 if (OpInfo->Class == AML_CLASS_UNKNOWN)
672 return_ACPI_STATUS (AE_TYPE);
675 /* Perform per-object initialization */
677 switch (ObjDesc->Common.Type)
679 case ACPI_TYPE_BUFFER:
681 * Defer evaluation of Buffer TermArg operand
683 ObjDesc->Buffer.Node = ACPI_CAST_PTR (
684 ACPI_NAMESPACE_NODE, WalkState->Operands[0]);
685 ObjDesc->Buffer.AmlStart = Op->Named.Data;
686 ObjDesc->Buffer.AmlLength = Op->Named.Length;
689 case ACPI_TYPE_PACKAGE:
691 * Defer evaluation of Package TermArg operand
693 ObjDesc->Package.Node = ACPI_CAST_PTR (
694 ACPI_NAMESPACE_NODE, WalkState->Operands[0]);
695 ObjDesc->Package.AmlStart = Op->Named.Data;
696 ObjDesc->Package.AmlLength = Op->Named.Length;
699 case ACPI_TYPE_INTEGER:
701 switch (OpInfo->Type)
703 case AML_TYPE_CONSTANT:
705 * Resolve AML Constants here - AND ONLY HERE!
706 * All constants are integers.
707 * We mark the integer with a flag that indicates that it started
708 * life as a constant -- so that stores to constants will perform
709 * as expected (noop). ZeroOp is used as a placeholder for optional
712 ObjDesc->Common.Flags = AOPOBJ_AML_CONSTANT;
718 ObjDesc->Integer.Value = 0;
723 ObjDesc->Integer.Value = 1;
728 ObjDesc->Integer.Value = ACPI_UINT64_MAX;
730 /* Truncate value if we are executing from a 32-bit ACPI table */
732 #ifndef ACPI_NO_METHOD_EXECUTION
733 (void) AcpiExTruncateFor32bitTable (ObjDesc);
737 case AML_REVISION_OP:
739 ObjDesc->Integer.Value = ACPI_CA_VERSION;
744 ACPI_ERROR ((AE_INFO,
745 "Unknown constant opcode 0x%X", Opcode));
746 Status = AE_AML_OPERAND_TYPE;
751 case AML_TYPE_LITERAL:
753 ObjDesc->Integer.Value = Op->Common.Value.Integer;
755 #ifndef ACPI_NO_METHOD_EXECUTION
756 if (AcpiExTruncateFor32bitTable (ObjDesc))
758 /* Warn if we found a 64-bit constant in a 32-bit table */
760 ACPI_WARNING ((AE_INFO,
761 "Truncated 64-bit constant found in 32-bit table: %8.8X%8.8X => %8.8X",
762 ACPI_FORMAT_UINT64 (Op->Common.Value.Integer),
763 (UINT32) ObjDesc->Integer.Value));
770 ACPI_ERROR ((AE_INFO, "Unknown Integer type 0x%X",
772 Status = AE_AML_OPERAND_TYPE;
777 case ACPI_TYPE_STRING:
779 ObjDesc->String.Pointer = Op->Common.Value.String;
780 ObjDesc->String.Length = (UINT32) strlen (Op->Common.Value.String);
783 * The string is contained in the ACPI table, don't ever try
786 ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER;
789 case ACPI_TYPE_METHOD:
792 case ACPI_TYPE_LOCAL_REFERENCE:
794 switch (OpInfo->Type)
796 case AML_TYPE_LOCAL_VARIABLE:
798 /* Local ID (0-7) is (AML opcode - base AML_LOCAL_OP) */
800 ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_LOCAL_OP;
801 ObjDesc->Reference.Class = ACPI_REFCLASS_LOCAL;
803 #ifndef ACPI_NO_METHOD_EXECUTION
804 Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_LOCAL,
805 ObjDesc->Reference.Value, WalkState,
806 ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
807 &ObjDesc->Reference.Object));
811 case AML_TYPE_METHOD_ARGUMENT:
813 /* Arg ID (0-6) is (AML opcode - base AML_ARG_OP) */
815 ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_ARG_OP;
816 ObjDesc->Reference.Class = ACPI_REFCLASS_ARG;
818 #ifndef ACPI_NO_METHOD_EXECUTION
819 Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_ARG,
820 ObjDesc->Reference.Value, WalkState,
821 ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
822 &ObjDesc->Reference.Object));
826 default: /* Object name or Debug object */
828 switch (Op->Common.AmlOpcode)
830 case AML_INT_NAMEPATH_OP:
832 /* Node was saved in Op */
834 ObjDesc->Reference.Node = Op->Common.Node;
835 ObjDesc->Reference.Object = Op->Common.Node->Object;
836 ObjDesc->Reference.Class = ACPI_REFCLASS_NAME;
841 ObjDesc->Reference.Class = ACPI_REFCLASS_DEBUG;
846 ACPI_ERROR ((AE_INFO,
847 "Unimplemented reference type for AML opcode: 0x%4.4X", Opcode));
848 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
856 ACPI_ERROR ((AE_INFO, "Unimplemented data type: 0x%X",
857 ObjDesc->Common.Type));
859 Status = AE_AML_OPERAND_TYPE;
863 return_ACPI_STATUS (Status);