1 /*******************************************************************************
3 * Module Name: dsmthdat - control method arguments and local variables
5 ******************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
12 * All rights reserved.
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
37 * The above copyright and patent license is granted only if the following
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
72 * 3.4. Intel retains all right, title, and interest in and to the Original
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
80 * 4. Disclaimer and Export Compliance
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
114 *****************************************************************************/
116 #define __DSMTHDAT_C__
119 #include "accommon.h"
120 #include "acdispat.h"
121 #include "acnamesp.h"
122 #include "acinterp.h"
125 #define _COMPONENT ACPI_DISPATCHER
126 ACPI_MODULE_NAME ("dsmthdat")
128 /* Local prototypes */
131 AcpiDsMethodDataDeleteValue (
134 ACPI_WALK_STATE
*WalkState
);
137 AcpiDsMethodDataSetValue (
140 ACPI_OPERAND_OBJECT
*Object
,
141 ACPI_WALK_STATE
*WalkState
);
143 #ifdef ACPI_OBSOLETE_FUNCTIONS
145 AcpiDsMethodDataGetType (
148 ACPI_WALK_STATE
*WalkState
);
152 /*******************************************************************************
154 * FUNCTION: AcpiDsMethodDataInit
156 * PARAMETERS: WalkState - Current walk state object
160 * DESCRIPTION: Initialize the data structures that hold the method's arguments
161 * and locals. The data struct is an array of namespace nodes for
162 * each - this allows RefOf and DeRefOf to work properly for these
163 * special data types.
165 * NOTES: WalkState fields are initialized to zero by the
166 * ACPI_ALLOCATE_ZEROED().
168 * A pseudo-Namespace Node is assigned to each argument and local
169 * so that RefOf() can return a pointer to the Node.
171 ******************************************************************************/
174 AcpiDsMethodDataInit (
175 ACPI_WALK_STATE
*WalkState
)
180 ACPI_FUNCTION_TRACE (DsMethodDataInit
);
183 /* Init the method arguments */
185 for (i
= 0; i
< ACPI_METHOD_NUM_ARGS
; i
++)
187 ACPI_MOVE_32_TO_32 (&WalkState
->Arguments
[i
].Name
, NAMEOF_ARG_NTE
);
188 WalkState
->Arguments
[i
].Name
.Integer
|= (i
<< 24);
189 WalkState
->Arguments
[i
].DescriptorType
= ACPI_DESC_TYPE_NAMED
;
190 WalkState
->Arguments
[i
].Type
= ACPI_TYPE_ANY
;
191 WalkState
->Arguments
[i
].Flags
=
192 ANOBJ_END_OF_PEER_LIST
| ANOBJ_METHOD_ARG
;
195 /* Init the method locals */
197 for (i
= 0; i
< ACPI_METHOD_NUM_LOCALS
; i
++)
199 ACPI_MOVE_32_TO_32 (&WalkState
->LocalVariables
[i
].Name
, NAMEOF_LOCAL_NTE
);
201 WalkState
->LocalVariables
[i
].Name
.Integer
|= (i
<< 24);
202 WalkState
->LocalVariables
[i
].DescriptorType
= ACPI_DESC_TYPE_NAMED
;
203 WalkState
->LocalVariables
[i
].Type
= ACPI_TYPE_ANY
;
204 WalkState
->LocalVariables
[i
].Flags
=
205 ANOBJ_END_OF_PEER_LIST
| ANOBJ_METHOD_LOCAL
;
212 /*******************************************************************************
214 * FUNCTION: AcpiDsMethodDataDeleteAll
216 * PARAMETERS: WalkState - Current walk state object
220 * DESCRIPTION: Delete method locals and arguments. Arguments are only
221 * deleted if this method was called from another method.
223 ******************************************************************************/
226 AcpiDsMethodDataDeleteAll (
227 ACPI_WALK_STATE
*WalkState
)
232 ACPI_FUNCTION_TRACE (DsMethodDataDeleteAll
);
235 /* Detach the locals */
237 for (Index
= 0; Index
< ACPI_METHOD_NUM_LOCALS
; Index
++)
239 if (WalkState
->LocalVariables
[Index
].Object
)
241 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "Deleting Local%d=%p\n",
242 Index
, WalkState
->LocalVariables
[Index
].Object
));
244 /* Detach object (if present) and remove a reference */
246 AcpiNsDetachObject (&WalkState
->LocalVariables
[Index
]);
250 /* Detach the arguments */
252 for (Index
= 0; Index
< ACPI_METHOD_NUM_ARGS
; Index
++)
254 if (WalkState
->Arguments
[Index
].Object
)
256 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "Deleting Arg%d=%p\n",
257 Index
, WalkState
->Arguments
[Index
].Object
));
259 /* Detach object (if present) and remove a reference */
261 AcpiNsDetachObject (&WalkState
->Arguments
[Index
]);
269 /*******************************************************************************
271 * FUNCTION: AcpiDsMethodDataInitArgs
273 * PARAMETERS: *Params - Pointer to a parameter list for the method
274 * MaxParamCount - The arg count for this method
275 * WalkState - Current walk state object
279 * DESCRIPTION: Initialize arguments for a method. The parameter list is a list
280 * of ACPI operand objects, either null terminated or whose length
281 * is defined by MaxParamCount.
283 ******************************************************************************/
286 AcpiDsMethodDataInitArgs (
287 ACPI_OPERAND_OBJECT
**Params
,
288 UINT32 MaxParamCount
,
289 ACPI_WALK_STATE
*WalkState
)
295 ACPI_FUNCTION_TRACE_PTR (DsMethodDataInitArgs
, Params
);
300 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "No param list passed to method\n"));
301 return_ACPI_STATUS (AE_OK
);
304 /* Copy passed parameters into the new method stack frame */
306 while ((Index
< ACPI_METHOD_NUM_ARGS
) &&
307 (Index
< MaxParamCount
) &&
312 * Store the argument in the method/walk descriptor.
313 * Do not copy the arg in order to implement call by reference
315 Status
= AcpiDsMethodDataSetValue (ACPI_REFCLASS_ARG
, Index
,
316 Params
[Index
], WalkState
);
317 if (ACPI_FAILURE (Status
))
319 return_ACPI_STATUS (Status
);
325 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "%d args passed to method\n", Index
));
326 return_ACPI_STATUS (AE_OK
);
330 /*******************************************************************************
332 * FUNCTION: AcpiDsMethodDataGetNode
334 * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or
336 * Index - Which Local or Arg whose type to get
337 * WalkState - Current walk state object
338 * Node - Where the node is returned.
340 * RETURN: Status and node
342 * DESCRIPTION: Get the Node associated with a local or arg.
344 ******************************************************************************/
347 AcpiDsMethodDataGetNode (
350 ACPI_WALK_STATE
*WalkState
,
351 ACPI_NAMESPACE_NODE
**Node
)
353 ACPI_FUNCTION_TRACE (DsMethodDataGetNode
);
357 * Method Locals and Arguments are supported
361 case ACPI_REFCLASS_LOCAL
:
363 if (Index
> ACPI_METHOD_MAX_LOCAL
)
365 ACPI_ERROR ((AE_INFO
,
366 "Local index %d is invalid (max %d)",
367 Index
, ACPI_METHOD_MAX_LOCAL
));
368 return_ACPI_STATUS (AE_AML_INVALID_INDEX
);
371 /* Return a pointer to the pseudo-node */
373 *Node
= &WalkState
->LocalVariables
[Index
];
376 case ACPI_REFCLASS_ARG
:
378 if (Index
> ACPI_METHOD_MAX_ARG
)
380 ACPI_ERROR ((AE_INFO
,
381 "Arg index %d is invalid (max %d)",
382 Index
, ACPI_METHOD_MAX_ARG
));
383 return_ACPI_STATUS (AE_AML_INVALID_INDEX
);
386 /* Return a pointer to the pseudo-node */
388 *Node
= &WalkState
->Arguments
[Index
];
392 ACPI_ERROR ((AE_INFO
, "Type %d is invalid", Type
));
393 return_ACPI_STATUS (AE_TYPE
);
396 return_ACPI_STATUS (AE_OK
);
400 /*******************************************************************************
402 * FUNCTION: AcpiDsMethodDataSetValue
404 * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or
406 * Index - Which Local or Arg to get
407 * Object - Object to be inserted into the stack entry
408 * WalkState - Current walk state object
412 * DESCRIPTION: Insert an object onto the method stack at entry Opcode:Index.
413 * Note: There is no "implicit conversion" for locals.
415 ******************************************************************************/
418 AcpiDsMethodDataSetValue (
421 ACPI_OPERAND_OBJECT
*Object
,
422 ACPI_WALK_STATE
*WalkState
)
425 ACPI_NAMESPACE_NODE
*Node
;
428 ACPI_FUNCTION_TRACE (DsMethodDataSetValue
);
431 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
,
432 "NewObj %p Type %2.2X, Refs=%d [%s]\n", Object
,
433 Type
, Object
->Common
.ReferenceCount
,
434 AcpiUtGetTypeName (Object
->Common
.Type
)));
436 /* Get the namespace node for the arg/local */
438 Status
= AcpiDsMethodDataGetNode (Type
, Index
, WalkState
, &Node
);
439 if (ACPI_FAILURE (Status
))
441 return_ACPI_STATUS (Status
);
445 * Increment ref count so object can't be deleted while installed.
446 * NOTE: We do not copy the object in order to preserve the call by
447 * reference semantics of ACPI Control Method invocation.
448 * (See ACPI Specification 2.0C)
450 AcpiUtAddReference (Object
);
452 /* Install the object */
454 Node
->Object
= Object
;
455 return_ACPI_STATUS (Status
);
459 /*******************************************************************************
461 * FUNCTION: AcpiDsMethodDataGetValue
463 * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or
465 * Index - Which localVar or argument to get
466 * WalkState - Current walk state object
467 * DestDesc - Where Arg or Local value is returned
471 * DESCRIPTION: Retrieve value of selected Arg or Local for this method
472 * Used only in AcpiExResolveToValue().
474 ******************************************************************************/
477 AcpiDsMethodDataGetValue (
480 ACPI_WALK_STATE
*WalkState
,
481 ACPI_OPERAND_OBJECT
**DestDesc
)
484 ACPI_NAMESPACE_NODE
*Node
;
485 ACPI_OPERAND_OBJECT
*Object
;
488 ACPI_FUNCTION_TRACE (DsMethodDataGetValue
);
491 /* Validate the object descriptor */
495 ACPI_ERROR ((AE_INFO
, "Null object descriptor pointer"));
496 return_ACPI_STATUS (AE_BAD_PARAMETER
);
499 /* Get the namespace node for the arg/local */
501 Status
= AcpiDsMethodDataGetNode (Type
, Index
, WalkState
, &Node
);
502 if (ACPI_FAILURE (Status
))
504 return_ACPI_STATUS (Status
);
507 /* Get the object from the node */
509 Object
= Node
->Object
;
511 /* Examine the returned object, it must be valid. */
516 * Index points to uninitialized object.
517 * This means that either 1) The expected argument was
518 * not passed to the method, or 2) A local variable
519 * was referenced by the method (via the ASL)
520 * before it was initialized. Either case is an error.
523 /* If slack enabled, init the LocalX/ArgX to an Integer of value zero */
525 if (AcpiGbl_EnableInterpreterSlack
)
527 Object
= AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER
);
530 return_ACPI_STATUS (AE_NO_MEMORY
);
533 Object
->Integer
.Value
= 0;
534 Node
->Object
= Object
;
537 /* Otherwise, return the error */
541 case ACPI_REFCLASS_ARG
:
543 ACPI_ERROR ((AE_INFO
,
544 "Uninitialized Arg[%d] at node %p",
547 return_ACPI_STATUS (AE_AML_UNINITIALIZED_ARG
);
549 case ACPI_REFCLASS_LOCAL
:
551 ACPI_ERROR ((AE_INFO
,
552 "Uninitialized Local[%d] at node %p", Index
, Node
));
554 return_ACPI_STATUS (AE_AML_UNINITIALIZED_LOCAL
);
558 ACPI_ERROR ((AE_INFO
, "Not a Arg/Local opcode: %X", Type
));
559 return_ACPI_STATUS (AE_AML_INTERNAL
);
564 * The Index points to an initialized and valid object.
565 * Return an additional reference to the object
568 AcpiUtAddReference (Object
);
570 return_ACPI_STATUS (AE_OK
);
574 /*******************************************************************************
576 * FUNCTION: AcpiDsMethodDataDeleteValue
578 * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or
580 * Index - Which localVar or argument to delete
581 * WalkState - Current walk state object
585 * DESCRIPTION: Delete the entry at Opcode:Index. Inserts
586 * a null into the stack slot after the object is deleted.
588 ******************************************************************************/
591 AcpiDsMethodDataDeleteValue (
594 ACPI_WALK_STATE
*WalkState
)
597 ACPI_NAMESPACE_NODE
*Node
;
598 ACPI_OPERAND_OBJECT
*Object
;
601 ACPI_FUNCTION_TRACE (DsMethodDataDeleteValue
);
604 /* Get the namespace node for the arg/local */
606 Status
= AcpiDsMethodDataGetNode (Type
, Index
, WalkState
, &Node
);
607 if (ACPI_FAILURE (Status
))
612 /* Get the associated object */
614 Object
= AcpiNsGetAttachedObject (Node
);
617 * Undefine the Arg or Local by setting its descriptor
618 * pointer to NULL. Locals/Args can contain both
619 * ACPI_OPERAND_OBJECTS and ACPI_NAMESPACE_NODEs
624 (ACPI_GET_DESCRIPTOR_TYPE (Object
) == ACPI_DESC_TYPE_OPERAND
))
627 * There is a valid object.
628 * Decrement the reference count by one to balance the
629 * increment when the object was stored.
631 AcpiUtRemoveReference (Object
);
638 /*******************************************************************************
640 * FUNCTION: AcpiDsStoreObjectToLocal
642 * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or
644 * Index - Which Local or Arg to set
645 * ObjDesc - Value to be stored
646 * WalkState - Current walk state
650 * DESCRIPTION: Store a value in an Arg or Local. The ObjDesc is installed
651 * as the new value for the Arg or Local and the reference count
652 * for ObjDesc is incremented.
654 ******************************************************************************/
657 AcpiDsStoreObjectToLocal (
660 ACPI_OPERAND_OBJECT
*ObjDesc
,
661 ACPI_WALK_STATE
*WalkState
)
664 ACPI_NAMESPACE_NODE
*Node
;
665 ACPI_OPERAND_OBJECT
*CurrentObjDesc
;
666 ACPI_OPERAND_OBJECT
*NewObjDesc
;
669 ACPI_FUNCTION_TRACE (DsStoreObjectToLocal
);
670 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "Type=%2.2X Index=%d Obj=%p\n",
671 Type
, Index
, ObjDesc
));
673 /* Parameter validation */
677 return_ACPI_STATUS (AE_BAD_PARAMETER
);
680 /* Get the namespace node for the arg/local */
682 Status
= AcpiDsMethodDataGetNode (Type
, Index
, WalkState
, &Node
);
683 if (ACPI_FAILURE (Status
))
685 return_ACPI_STATUS (Status
);
688 CurrentObjDesc
= AcpiNsGetAttachedObject (Node
);
689 if (CurrentObjDesc
== ObjDesc
)
691 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "Obj=%p already installed!\n",
693 return_ACPI_STATUS (Status
);
697 * If the reference count on the object is more than one, we must
698 * take a copy of the object before we store. A reference count
699 * of exactly 1 means that the object was just created during the
700 * evaluation of an expression, and we can safely use it since it
701 * is not used anywhere else.
703 NewObjDesc
= ObjDesc
;
704 if (ObjDesc
->Common
.ReferenceCount
> 1)
706 Status
= AcpiUtCopyIobjectToIobject (ObjDesc
, &NewObjDesc
, WalkState
);
707 if (ACPI_FAILURE (Status
))
709 return_ACPI_STATUS (Status
);
714 * If there is an object already in this slot, we either
715 * have to delete it, or if this is an argument and there
716 * is an object reference stored there, we have to do
722 * Check for an indirect store if an argument
723 * contains an object reference (stored as an Node).
724 * We don't allow this automatic dereferencing for
725 * locals, since a store to a local should overwrite
726 * anything there, including an object reference.
728 * If both Arg0 and Local0 contain RefOf (Local4):
730 * Store (1, Arg0) - Causes indirect store to local4
731 * Store (1, Local0) - Stores 1 in local0, overwriting
732 * the reference to local4
733 * Store (1, DeRefof (Local0)) - Causes indirect store to local4
737 if (Type
== ACPI_REFCLASS_ARG
)
740 * If we have a valid reference object that came from RefOf(),
741 * do the indirect store
743 if ((ACPI_GET_DESCRIPTOR_TYPE (CurrentObjDesc
) == ACPI_DESC_TYPE_OPERAND
) &&
744 (CurrentObjDesc
->Common
.Type
== ACPI_TYPE_LOCAL_REFERENCE
) &&
745 (CurrentObjDesc
->Reference
.Class
== ACPI_REFCLASS_REFOF
))
747 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
,
748 "Arg (%p) is an ObjRef(Node), storing in node %p\n",
749 NewObjDesc
, CurrentObjDesc
));
752 * Store this object to the Node (perform the indirect store)
753 * NOTE: No implicit conversion is performed, as per the ACPI
754 * specification rules on storing to Locals/Args.
756 Status
= AcpiExStoreObjectToNode (NewObjDesc
,
757 CurrentObjDesc
->Reference
.Object
, WalkState
,
758 ACPI_NO_IMPLICIT_CONVERSION
);
760 /* Remove local reference if we copied the object above */
762 if (NewObjDesc
!= ObjDesc
)
764 AcpiUtRemoveReference (NewObjDesc
);
766 return_ACPI_STATUS (Status
);
770 /* Delete the existing object before storing the new one */
772 AcpiDsMethodDataDeleteValue (Type
, Index
, WalkState
);
776 * Install the Obj descriptor (*NewObjDesc) into
777 * the descriptor for the Arg or Local.
778 * (increments the object reference count by one)
780 Status
= AcpiDsMethodDataSetValue (Type
, Index
, NewObjDesc
, WalkState
);
782 /* Remove local reference if we copied the object above */
784 if (NewObjDesc
!= ObjDesc
)
786 AcpiUtRemoveReference (NewObjDesc
);
789 return_ACPI_STATUS (Status
);
793 #ifdef ACPI_OBSOLETE_FUNCTIONS
794 /*******************************************************************************
796 * FUNCTION: AcpiDsMethodDataGetType
798 * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP
799 * Index - Which Local or Arg whose type to get
800 * WalkState - Current walk state object
802 * RETURN: Data type of current value of the selected Arg or Local
804 * DESCRIPTION: Get the type of the object stored in the Local or Arg
806 ******************************************************************************/
809 AcpiDsMethodDataGetType (
812 ACPI_WALK_STATE
*WalkState
)
815 ACPI_NAMESPACE_NODE
*Node
;
816 ACPI_OPERAND_OBJECT
*Object
;
819 ACPI_FUNCTION_TRACE (DsMethodDataGetType
);
822 /* Get the namespace node for the arg/local */
824 Status
= AcpiDsMethodDataGetNode (Opcode
, Index
, WalkState
, &Node
);
825 if (ACPI_FAILURE (Status
))
827 return_VALUE ((ACPI_TYPE_NOT_FOUND
));
832 Object
= AcpiNsGetAttachedObject (Node
);
835 /* Uninitialized local/arg, return TYPE_ANY */
837 return_VALUE (ACPI_TYPE_ANY
);
840 /* Get the object type */
842 return_VALUE (Object
->Type
);