1 /******************************************************************************
3 * Module Name: dsobject - Dispatcher object management routines
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2013, 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 #define __DSOBJECT_C__
54 #define _COMPONENT ACPI_DISPATCHER
55 ACPI_MODULE_NAME ("dsobject")
57 /* Local prototypes */
60 AcpiDsBuildInternalObject (
61 ACPI_WALK_STATE
*WalkState
,
62 ACPI_PARSE_OBJECT
*Op
,
63 ACPI_OPERAND_OBJECT
**ObjDescPtr
);
66 #ifndef ACPI_NO_METHOD_EXECUTION
67 /*******************************************************************************
69 * FUNCTION: AcpiDsBuildInternalObject
71 * PARAMETERS: WalkState - Current walk state
72 * Op - Parser object to be translated
73 * ObjDescPtr - Where the ACPI internal object is returned
77 * DESCRIPTION: Translate a parser Op object to the equivalent namespace object
78 * Simple objects are any objects other than a package object!
80 ******************************************************************************/
83 AcpiDsBuildInternalObject (
84 ACPI_WALK_STATE
*WalkState
,
85 ACPI_PARSE_OBJECT
*Op
,
86 ACPI_OPERAND_OBJECT
**ObjDescPtr
)
88 ACPI_OPERAND_OBJECT
*ObjDesc
;
90 ACPI_OBJECT_TYPE Type
;
93 ACPI_FUNCTION_TRACE (DsBuildInternalObject
);
97 if (Op
->Common
.AmlOpcode
== AML_INT_NAMEPATH_OP
)
100 * This is a named object reference. If this name was
101 * previously looked up in the namespace, it was stored in this op.
102 * Otherwise, go ahead and look it up now
104 if (!Op
->Common
.Node
)
106 Status
= AcpiNsLookup (WalkState
->ScopeInfo
,
107 Op
->Common
.Value
.String
,
108 ACPI_TYPE_ANY
, ACPI_IMODE_EXECUTE
,
109 ACPI_NS_SEARCH_PARENT
| ACPI_NS_DONT_OPEN_SCOPE
, NULL
,
110 ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE
, &(Op
->Common
.Node
)));
111 if (ACPI_FAILURE (Status
))
113 /* Check if we are resolving a named reference within a package */
115 if ((Status
== AE_NOT_FOUND
) && (AcpiGbl_EnableInterpreterSlack
) &&
117 ((Op
->Common
.Parent
->Common
.AmlOpcode
== AML_PACKAGE_OP
) ||
118 (Op
->Common
.Parent
->Common
.AmlOpcode
== AML_VAR_PACKAGE_OP
)))
121 * We didn't find the target and we are populating elements
122 * of a package - ignore if slack enabled. Some ASL code
123 * contains dangling invalid references in packages and
124 * expects that no exception will be issued. Leave the
125 * element as a null element. It cannot be used, but it
126 * can be overwritten by subsequent ASL code - this is
127 * typically the case.
129 ACPI_DEBUG_PRINT ((ACPI_DB_INFO
,
130 "Ignoring unresolved reference in package [%4.4s]\n",
131 WalkState
->ScopeInfo
->Scope
.Node
->Name
.Ascii
));
133 return_ACPI_STATUS (AE_OK
);
137 ACPI_ERROR_NAMESPACE (Op
->Common
.Value
.String
, Status
);
140 return_ACPI_STATUS (Status
);
144 /* Special object resolution for elements of a package */
146 if ((Op
->Common
.Parent
->Common
.AmlOpcode
== AML_PACKAGE_OP
) ||
147 (Op
->Common
.Parent
->Common
.AmlOpcode
== AML_VAR_PACKAGE_OP
))
150 * Attempt to resolve the node to a value before we insert it into
151 * the package. If this is a reference to a common data type,
152 * resolve it immediately. According to the ACPI spec, package
153 * elements can only be "data objects" or method references.
154 * Attempt to resolve to an Integer, Buffer, String or Package.
155 * If cannot, return the named reference (for things like Devices,
156 * Methods, etc.) Buffer Fields and Fields will resolve to simple
157 * objects (int/buf/str/pkg).
159 * NOTE: References to things like Devices, Methods, Mutexes, etc.
160 * will remain as named references. This behavior is not described
161 * in the ACPI spec, but it appears to be an oversight.
163 ObjDesc
= ACPI_CAST_PTR (ACPI_OPERAND_OBJECT
, Op
->Common
.Node
);
165 Status
= AcpiExResolveNodeToValue (
166 ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE
, &ObjDesc
),
168 if (ACPI_FAILURE (Status
))
170 return_ACPI_STATUS (Status
);
174 * Special handling for Alias objects. We need to setup the type
175 * and the Op->Common.Node to point to the Alias target. Note,
176 * Alias has at most one level of indirection internally.
178 Type
= Op
->Common
.Node
->Type
;
179 if (Type
== ACPI_TYPE_LOCAL_ALIAS
)
181 Type
= ObjDesc
->Common
.Type
;
182 Op
->Common
.Node
= ACPI_CAST_PTR (ACPI_NAMESPACE_NODE
,
183 Op
->Common
.Node
->Object
);
189 * For these types, we need the actual node, not the subobject.
190 * However, the subobject did not get an extra reference count above.
192 * TBD: should ExResolveNodeToValue be changed to fix this?
194 case ACPI_TYPE_DEVICE
:
195 case ACPI_TYPE_THERMAL
:
197 AcpiUtAddReference (Op
->Common
.Node
->Object
);
199 /*lint -fallthrough */
201 * For these types, we need the actual node, not the subobject.
202 * The subobject got an extra reference count in ExResolveNodeToValue.
204 case ACPI_TYPE_MUTEX
:
205 case ACPI_TYPE_METHOD
:
206 case ACPI_TYPE_POWER
:
207 case ACPI_TYPE_PROCESSOR
:
208 case ACPI_TYPE_EVENT
:
209 case ACPI_TYPE_REGION
:
211 /* We will create a reference object for these types below */
216 * All other types - the node was resolved to an actual
217 * object, we are done.
224 /* Create and init a new internal ACPI object */
226 ObjDesc
= AcpiUtCreateInternalObject (
227 (AcpiPsGetOpcodeInfo (Op
->Common
.AmlOpcode
))->ObjectType
);
230 return_ACPI_STATUS (AE_NO_MEMORY
);
233 Status
= AcpiDsInitObjectFromOp (WalkState
, Op
, Op
->Common
.AmlOpcode
,
235 if (ACPI_FAILURE (Status
))
237 AcpiUtRemoveReference (ObjDesc
);
238 return_ACPI_STATUS (Status
);
242 *ObjDescPtr
= ObjDesc
;
243 return_ACPI_STATUS (Status
);
247 /*******************************************************************************
249 * FUNCTION: AcpiDsBuildInternalBufferObj
251 * PARAMETERS: WalkState - Current walk state
252 * Op - Parser object to be translated
253 * BufferLength - Length of the buffer
254 * ObjDescPtr - Where the ACPI internal object is returned
258 * DESCRIPTION: Translate a parser Op package object to the equivalent
261 ******************************************************************************/
264 AcpiDsBuildInternalBufferObj (
265 ACPI_WALK_STATE
*WalkState
,
266 ACPI_PARSE_OBJECT
*Op
,
268 ACPI_OPERAND_OBJECT
**ObjDescPtr
)
270 ACPI_PARSE_OBJECT
*Arg
;
271 ACPI_OPERAND_OBJECT
*ObjDesc
;
272 ACPI_PARSE_OBJECT
*ByteList
;
273 UINT32 ByteListLength
= 0;
276 ACPI_FUNCTION_TRACE (DsBuildInternalBufferObj
);
280 * If we are evaluating a Named buffer object "Name (xxxx, Buffer)".
281 * The buffer object already exists (from the NS node), otherwise it must
284 ObjDesc
= *ObjDescPtr
;
287 /* Create a new buffer object */
289 ObjDesc
= AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER
);
290 *ObjDescPtr
= ObjDesc
;
293 return_ACPI_STATUS (AE_NO_MEMORY
);
298 * Second arg is the buffer data (optional) ByteList can be either
299 * individual bytes or a string initializer. In either case, a
300 * ByteList appears in the AML.
302 Arg
= Op
->Common
.Value
.Arg
; /* skip first arg */
304 ByteList
= Arg
->Named
.Next
;
307 if (ByteList
->Common
.AmlOpcode
!= AML_INT_BYTELIST_OP
)
309 ACPI_ERROR ((AE_INFO
,
310 "Expecting bytelist, found AML opcode 0x%X in op %p",
311 ByteList
->Common
.AmlOpcode
, ByteList
));
313 AcpiUtRemoveReference (ObjDesc
);
317 ByteListLength
= (UINT32
) ByteList
->Common
.Value
.Integer
;
321 * The buffer length (number of bytes) will be the larger of:
322 * 1) The specified buffer length and
323 * 2) The length of the initializer byte list
325 ObjDesc
->Buffer
.Length
= BufferLength
;
326 if (ByteListLength
> BufferLength
)
328 ObjDesc
->Buffer
.Length
= ByteListLength
;
331 /* Allocate the buffer */
333 if (ObjDesc
->Buffer
.Length
== 0)
335 ObjDesc
->Buffer
.Pointer
= NULL
;
336 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
,
337 "Buffer defined with zero length in AML, creating\n"));
341 ObjDesc
->Buffer
.Pointer
= ACPI_ALLOCATE_ZEROED (
342 ObjDesc
->Buffer
.Length
);
343 if (!ObjDesc
->Buffer
.Pointer
)
345 AcpiUtDeleteObjectDesc (ObjDesc
);
346 return_ACPI_STATUS (AE_NO_MEMORY
);
349 /* Initialize buffer from the ByteList (if present) */
353 ACPI_MEMCPY (ObjDesc
->Buffer
.Pointer
, ByteList
->Named
.Data
,
358 ObjDesc
->Buffer
.Flags
|= AOPOBJ_DATA_VALID
;
359 Op
->Common
.Node
= ACPI_CAST_PTR (ACPI_NAMESPACE_NODE
, ObjDesc
);
360 return_ACPI_STATUS (AE_OK
);
364 /*******************************************************************************
366 * FUNCTION: AcpiDsBuildInternalPackageObj
368 * PARAMETERS: WalkState - Current walk state
369 * Op - Parser object to be translated
370 * ElementCount - Number of elements in the package - this is
371 * the NumElements argument to Package()
372 * ObjDescPtr - Where the ACPI internal object is returned
376 * DESCRIPTION: Translate a parser Op package object to the equivalent
379 * NOTE: The number of elements in the package will be always be the NumElements
380 * count, regardless of the number of elements in the package list. If
381 * NumElements is smaller, only that many package list elements are used.
382 * if NumElements is larger, the Package object is padded out with
383 * objects of type Uninitialized (as per ACPI spec.)
385 * Even though the ASL compilers do not allow NumElements to be smaller
386 * than the Package list length (for the fixed length package opcode), some
387 * BIOS code modifies the AML on the fly to adjust the NumElements, and
388 * this code compensates for that. This also provides compatibility with
389 * other AML interpreters.
391 ******************************************************************************/
394 AcpiDsBuildInternalPackageObj (
395 ACPI_WALK_STATE
*WalkState
,
396 ACPI_PARSE_OBJECT
*Op
,
398 ACPI_OPERAND_OBJECT
**ObjDescPtr
)
400 ACPI_PARSE_OBJECT
*Arg
;
401 ACPI_PARSE_OBJECT
*Parent
;
402 ACPI_OPERAND_OBJECT
*ObjDesc
= NULL
;
403 ACPI_STATUS Status
= AE_OK
;
406 UINT16 ReferenceCount
;
409 ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj
);
412 /* Find the parent of a possibly nested package */
414 Parent
= Op
->Common
.Parent
;
415 while ((Parent
->Common
.AmlOpcode
== AML_PACKAGE_OP
) ||
416 (Parent
->Common
.AmlOpcode
== AML_VAR_PACKAGE_OP
))
418 Parent
= Parent
->Common
.Parent
;
422 * If we are evaluating a Named package object "Name (xxxx, Package)",
423 * the package object already exists, otherwise it must be created.
425 ObjDesc
= *ObjDescPtr
;
428 ObjDesc
= AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE
);
429 *ObjDescPtr
= ObjDesc
;
432 return_ACPI_STATUS (AE_NO_MEMORY
);
435 ObjDesc
->Package
.Node
= Parent
->Common
.Node
;
439 * Allocate the element array (array of pointers to the individual
440 * objects) based on the NumElements parameter. Add an extra pointer slot
441 * so that the list is always null terminated.
443 ObjDesc
->Package
.Elements
= ACPI_ALLOCATE_ZEROED (
444 ((ACPI_SIZE
) ElementCount
+ 1) * sizeof (void *));
446 if (!ObjDesc
->Package
.Elements
)
448 AcpiUtDeleteObjectDesc (ObjDesc
);
449 return_ACPI_STATUS (AE_NO_MEMORY
);
452 ObjDesc
->Package
.Count
= ElementCount
;
455 * Initialize the elements of the package, up to the NumElements count.
456 * Package is automatically padded with uninitialized (NULL) elements
457 * if NumElements is greater than the package list length. Likewise,
458 * Package is truncated if NumElements is less than the list length.
460 Arg
= Op
->Common
.Value
.Arg
;
461 Arg
= Arg
->Common
.Next
;
462 for (i
= 0; Arg
&& (i
< ElementCount
); i
++)
464 if (Arg
->Common
.AmlOpcode
== AML_INT_RETURN_VALUE_OP
)
466 if (Arg
->Common
.Node
->Type
== ACPI_TYPE_METHOD
)
469 * A method reference "looks" to the parser to be a method
470 * invocation, so we special case it here
472 Arg
->Common
.AmlOpcode
= AML_INT_NAMEPATH_OP
;
473 Status
= AcpiDsBuildInternalObject (WalkState
, Arg
,
474 &ObjDesc
->Package
.Elements
[i
]);
478 /* This package element is already built, just get it */
480 ObjDesc
->Package
.Elements
[i
] =
481 ACPI_CAST_PTR (ACPI_OPERAND_OBJECT
, Arg
->Common
.Node
);
486 Status
= AcpiDsBuildInternalObject (WalkState
, Arg
,
487 &ObjDesc
->Package
.Elements
[i
]);
492 /* Existing package, get existing reference count */
494 ReferenceCount
= (*ObjDescPtr
)->Common
.ReferenceCount
;
495 if (ReferenceCount
> 1)
497 /* Make new element ref count match original ref count */
499 for (Index
= 0; Index
< (ReferenceCount
- 1); Index
++)
501 AcpiUtAddReference ((ObjDesc
->Package
.Elements
[i
]));
506 Arg
= Arg
->Common
.Next
;
509 /* Check for match between NumElements and actual length of PackageList */
514 * NumElements was exhausted, but there are remaining elements in the
515 * PackageList. Truncate the package to NumElements.
517 * Note: technically, this is an error, from ACPI spec: "It is an error
518 * for NumElements to be less than the number of elements in the
519 * PackageList". However, we just print a message and
520 * no exception is returned. This provides Windows compatibility. Some
521 * BIOSs will alter the NumElements on the fly, creating this type
522 * of ill-formed package object.
527 * We must delete any package elements that were created earlier
528 * and are not going to be used because of the package truncation.
530 if (Arg
->Common
.Node
)
532 AcpiUtRemoveReference (
533 ACPI_CAST_PTR (ACPI_OPERAND_OBJECT
, Arg
->Common
.Node
));
534 Arg
->Common
.Node
= NULL
;
537 /* Find out how many elements there really are */
540 Arg
= Arg
->Common
.Next
;
544 "Actual Package length (%u) is larger than NumElements field (%u), truncated",
547 else if (i
< ElementCount
)
550 * Arg list (elements) was exhausted, but we did not reach NumElements count.
551 * Note: this is not an error, the package is padded out with NULLs.
553 ACPI_DEBUG_PRINT ((ACPI_DB_INFO
,
554 "Package List length (%u) smaller than NumElements 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 (WalkState
, Op
->Common
.Value
.Arg
,
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 (ACPI_NAMESPACE_NODE
,
684 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 (ACPI_NAMESPACE_NODE
,
694 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
) ACPI_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
);