1 /******************************************************************************
3 * Module Name: dsopcode - Dispatcher support for regions and fields
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2015, 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 *****************************************************************************/
117 #include "accommon.h"
118 #include "acparser.h"
120 #include "acdispat.h"
121 #include "acinterp.h"
122 #include "acnamesp.h"
123 #include "acevents.h"
124 #include "actables.h"
126 #define _COMPONENT ACPI_DISPATCHER
127 ACPI_MODULE_NAME ("dsopcode")
129 /* Local prototypes */
132 AcpiDsInitBufferField (
134 ACPI_OPERAND_OBJECT *ObjDesc,
135 ACPI_OPERAND_OBJECT *BufferDesc,
136 ACPI_OPERAND_OBJECT *OffsetDesc,
137 ACPI_OPERAND_OBJECT *LengthDesc,
138 ACPI_OPERAND_OBJECT *ResultDesc);
141 /*******************************************************************************
143 * FUNCTION: AcpiDsInitializeRegion
145 * PARAMETERS: ObjHandle - Region namespace node
149 * DESCRIPTION: Front end to EvInitializeRegion
151 ******************************************************************************/
154 AcpiDsInitializeRegion (
155 ACPI_HANDLE ObjHandle)
157 ACPI_OPERAND_OBJECT *ObjDesc;
161 ObjDesc = AcpiNsGetAttachedObject (ObjHandle);
163 /* Namespace is NOT locked */
165 Status = AcpiEvInitializeRegion (ObjDesc, FALSE);
170 /*******************************************************************************
172 * FUNCTION: AcpiDsInitBufferField
174 * PARAMETERS: AmlOpcode - CreateXxxField
175 * ObjDesc - BufferField object
176 * BufferDesc - Host Buffer
177 * OffsetDesc - Offset into buffer
178 * LengthDesc - Length of field (CREATE_FIELD_OP only)
179 * ResultDesc - Where to store the result
183 * DESCRIPTION: Perform actual initialization of a buffer field
185 ******************************************************************************/
188 AcpiDsInitBufferField (
190 ACPI_OPERAND_OBJECT *ObjDesc,
191 ACPI_OPERAND_OBJECT *BufferDesc,
192 ACPI_OPERAND_OBJECT *OffsetDesc,
193 ACPI_OPERAND_OBJECT *LengthDesc,
194 ACPI_OPERAND_OBJECT *ResultDesc)
203 ACPI_FUNCTION_TRACE_PTR (DsInitBufferField, ObjDesc);
206 /* Host object must be a Buffer */
208 if (BufferDesc->Common.Type != ACPI_TYPE_BUFFER)
210 ACPI_ERROR ((AE_INFO,
211 "Target of Create Field is not a Buffer object - %s",
212 AcpiUtGetObjectTypeName (BufferDesc)));
214 Status = AE_AML_OPERAND_TYPE;
219 * The last parameter to all of these opcodes (ResultDesc) started
220 * out as a NameString, and should therefore now be a NS node
221 * after resolution in AcpiExResolveOperands().
223 if (ACPI_GET_DESCRIPTOR_TYPE (ResultDesc) != ACPI_DESC_TYPE_NAMED)
225 ACPI_ERROR ((AE_INFO,
226 "(%s) destination not a NS Node [%s]",
227 AcpiPsGetOpcodeName (AmlOpcode),
228 AcpiUtGetDescriptorName (ResultDesc)));
230 Status = AE_AML_OPERAND_TYPE;
234 Offset = (UINT32) OffsetDesc->Integer.Value;
237 * Setup the Bit offsets and counts, according to the opcode
241 case AML_CREATE_FIELD_OP:
243 /* Offset is in bits, count is in bits */
245 FieldFlags = AML_FIELD_ACCESS_BYTE;
247 BitCount = (UINT32) LengthDesc->Integer.Value;
249 /* Must have a valid (>0) bit count */
253 ACPI_ERROR ((AE_INFO,
254 "Attempt to CreateField of length zero"));
255 Status = AE_AML_OPERAND_VALUE;
260 case AML_CREATE_BIT_FIELD_OP:
262 /* Offset is in bits, Field is one bit */
266 FieldFlags = AML_FIELD_ACCESS_BYTE;
269 case AML_CREATE_BYTE_FIELD_OP:
271 /* Offset is in bytes, field is one byte */
273 BitOffset = 8 * Offset;
275 FieldFlags = AML_FIELD_ACCESS_BYTE;
278 case AML_CREATE_WORD_FIELD_OP:
280 /* Offset is in bytes, field is one word */
282 BitOffset = 8 * Offset;
284 FieldFlags = AML_FIELD_ACCESS_WORD;
287 case AML_CREATE_DWORD_FIELD_OP:
289 /* Offset is in bytes, field is one dword */
291 BitOffset = 8 * Offset;
293 FieldFlags = AML_FIELD_ACCESS_DWORD;
296 case AML_CREATE_QWORD_FIELD_OP:
298 /* Offset is in bytes, field is one qword */
300 BitOffset = 8 * Offset;
302 FieldFlags = AML_FIELD_ACCESS_QWORD;
307 ACPI_ERROR ((AE_INFO,
308 "Unknown field creation opcode 0x%02X",
310 Status = AE_AML_BAD_OPCODE;
314 /* Entire field must fit within the current length of the buffer */
316 if ((BitOffset + BitCount) >
317 (8 * (UINT32) BufferDesc->Buffer.Length))
319 ACPI_ERROR ((AE_INFO,
320 "Field [%4.4s] at %u exceeds Buffer [%4.4s] size %u (bits)",
321 AcpiUtGetNodeName (ResultDesc),
322 BitOffset + BitCount,
323 AcpiUtGetNodeName (BufferDesc->Buffer.Node),
324 8 * (UINT32) BufferDesc->Buffer.Length));
325 Status = AE_AML_BUFFER_LIMIT;
330 * Initialize areas of the field object that are common to all fields
331 * For FieldFlags, use LOCK_RULE = 0 (NO_LOCK),
332 * UPDATE_RULE = 0 (UPDATE_PRESERVE)
334 Status = AcpiExPrepCommonFieldObject (ObjDesc, FieldFlags, 0,
335 BitOffset, BitCount);
336 if (ACPI_FAILURE (Status))
341 ObjDesc->BufferField.BufferObj = BufferDesc;
343 /* Reference count for BufferDesc inherits ObjDesc count */
345 BufferDesc->Common.ReferenceCount = (UINT16)
346 (BufferDesc->Common.ReferenceCount + ObjDesc->Common.ReferenceCount);
351 /* Always delete the operands */
353 AcpiUtRemoveReference (OffsetDesc);
354 AcpiUtRemoveReference (BufferDesc);
356 if (AmlOpcode == AML_CREATE_FIELD_OP)
358 AcpiUtRemoveReference (LengthDesc);
361 /* On failure, delete the result descriptor */
363 if (ACPI_FAILURE (Status))
365 AcpiUtRemoveReference (ResultDesc); /* Result descriptor */
369 /* Now the address and length are valid for this BufferField */
371 ObjDesc->BufferField.Flags |= AOPOBJ_DATA_VALID;
374 return_ACPI_STATUS (Status);
378 /*******************************************************************************
380 * FUNCTION: AcpiDsEvalBufferFieldOperands
382 * PARAMETERS: WalkState - Current walk
383 * Op - A valid BufferField Op object
387 * DESCRIPTION: Get BufferField Buffer and Index
388 * Called from AcpiDsExecEndOp during BufferField parse tree walk
390 ******************************************************************************/
393 AcpiDsEvalBufferFieldOperands (
394 ACPI_WALK_STATE *WalkState,
395 ACPI_PARSE_OBJECT *Op)
398 ACPI_OPERAND_OBJECT *ObjDesc;
399 ACPI_NAMESPACE_NODE *Node;
400 ACPI_PARSE_OBJECT *NextOp;
403 ACPI_FUNCTION_TRACE_PTR (DsEvalBufferFieldOperands, Op);
407 * This is where we evaluate the address and length fields of the
408 * CreateXxxField declaration
410 Node = Op->Common.Node;
412 /* NextOp points to the op that holds the Buffer */
414 NextOp = Op->Common.Value.Arg;
416 /* Evaluate/create the address and length operands */
418 Status = AcpiDsCreateOperands (WalkState, NextOp);
419 if (ACPI_FAILURE (Status))
421 return_ACPI_STATUS (Status);
424 ObjDesc = AcpiNsGetAttachedObject (Node);
427 return_ACPI_STATUS (AE_NOT_EXIST);
430 /* Resolve the operands */
432 Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
433 ACPI_WALK_OPERANDS, WalkState);
434 if (ACPI_FAILURE (Status))
436 ACPI_ERROR ((AE_INFO, "(%s) bad operand(s), status 0x%X",
437 AcpiPsGetOpcodeName (Op->Common.AmlOpcode), Status));
439 return_ACPI_STATUS (Status);
442 /* Initialize the Buffer Field */
444 if (Op->Common.AmlOpcode == AML_CREATE_FIELD_OP)
446 /* NOTE: Slightly different operands for this opcode */
448 Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc,
449 WalkState->Operands[0], WalkState->Operands[1],
450 WalkState->Operands[2], WalkState->Operands[3]);
454 /* All other, CreateXxxField opcodes */
456 Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc,
457 WalkState->Operands[0], WalkState->Operands[1],
458 NULL, WalkState->Operands[2]);
461 return_ACPI_STATUS (Status);
465 /*******************************************************************************
467 * FUNCTION: AcpiDsEvalRegionOperands
469 * PARAMETERS: WalkState - Current walk
470 * Op - A valid region Op object
474 * DESCRIPTION: Get region address and length
475 * Called from AcpiDsExecEndOp during OpRegion parse tree walk
477 ******************************************************************************/
480 AcpiDsEvalRegionOperands (
481 ACPI_WALK_STATE *WalkState,
482 ACPI_PARSE_OBJECT *Op)
485 ACPI_OPERAND_OBJECT *ObjDesc;
486 ACPI_OPERAND_OBJECT *OperandDesc;
487 ACPI_NAMESPACE_NODE *Node;
488 ACPI_PARSE_OBJECT *NextOp;
491 ACPI_FUNCTION_TRACE_PTR (DsEvalRegionOperands, Op);
495 * This is where we evaluate the address and length fields of the
496 * OpRegion declaration
498 Node = Op->Common.Node;
500 /* NextOp points to the op that holds the SpaceID */
502 NextOp = Op->Common.Value.Arg;
504 /* NextOp points to address op */
506 NextOp = NextOp->Common.Next;
508 /* Evaluate/create the address and length operands */
510 Status = AcpiDsCreateOperands (WalkState, NextOp);
511 if (ACPI_FAILURE (Status))
513 return_ACPI_STATUS (Status);
516 /* Resolve the length and address operands to numbers */
518 Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
519 ACPI_WALK_OPERANDS, WalkState);
520 if (ACPI_FAILURE (Status))
522 return_ACPI_STATUS (Status);
525 ObjDesc = AcpiNsGetAttachedObject (Node);
528 return_ACPI_STATUS (AE_NOT_EXIST);
532 * Get the length operand and save it
535 OperandDesc = WalkState->Operands[WalkState->NumOperands - 1];
537 ObjDesc->Region.Length = (UINT32) OperandDesc->Integer.Value;
538 AcpiUtRemoveReference (OperandDesc);
541 * Get the address and save it
542 * (at top of stack - 1)
544 OperandDesc = WalkState->Operands[WalkState->NumOperands - 2];
546 ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS)
547 OperandDesc->Integer.Value;
548 AcpiUtRemoveReference (OperandDesc);
550 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
552 ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
553 ObjDesc->Region.Length));
555 /* Now the address and length are valid for this opregion */
557 ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;
559 return_ACPI_STATUS (Status);
563 /*******************************************************************************
565 * FUNCTION: AcpiDsEvalTableRegionOperands
567 * PARAMETERS: WalkState - Current walk
568 * Op - A valid region Op object
572 * DESCRIPTION: Get region address and length.
573 * Called from AcpiDsExecEndOp during DataTableRegion parse
576 ******************************************************************************/
579 AcpiDsEvalTableRegionOperands (
580 ACPI_WALK_STATE *WalkState,
581 ACPI_PARSE_OBJECT *Op)
584 ACPI_OPERAND_OBJECT *ObjDesc;
585 ACPI_OPERAND_OBJECT **Operand;
586 ACPI_NAMESPACE_NODE *Node;
587 ACPI_PARSE_OBJECT *NextOp;
589 ACPI_TABLE_HEADER *Table;
592 ACPI_FUNCTION_TRACE_PTR (DsEvalTableRegionOperands, Op);
596 * This is where we evaluate the Signature string, OemId string,
597 * and OemTableId string of the Data Table Region declaration
599 Node = Op->Common.Node;
601 /* NextOp points to Signature string op */
603 NextOp = Op->Common.Value.Arg;
606 * Evaluate/create the Signature string, OemId string,
607 * and OemTableId string operands
609 Status = AcpiDsCreateOperands (WalkState, NextOp);
610 if (ACPI_FAILURE (Status))
612 return_ACPI_STATUS (Status);
616 * Resolve the Signature string, OemId string,
617 * and OemTableId string operands
619 Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
620 ACPI_WALK_OPERANDS, WalkState);
621 if (ACPI_FAILURE (Status))
623 return_ACPI_STATUS (Status);
626 Operand = &WalkState->Operands[0];
628 /* Find the ACPI table */
630 Status = AcpiTbFindTable (Operand[0]->String.Pointer,
631 Operand[1]->String.Pointer, Operand[2]->String.Pointer,
633 if (ACPI_FAILURE (Status))
635 return_ACPI_STATUS (Status);
638 AcpiUtRemoveReference (Operand[0]);
639 AcpiUtRemoveReference (Operand[1]);
640 AcpiUtRemoveReference (Operand[2]);
642 Status = AcpiGetTableByIndex (TableIndex, &Table);
643 if (ACPI_FAILURE (Status))
645 return_ACPI_STATUS (Status);
648 ObjDesc = AcpiNsGetAttachedObject (Node);
651 return_ACPI_STATUS (AE_NOT_EXIST);
654 ObjDesc->Region.Address = ACPI_PTR_TO_PHYSADDR (Table);
655 ObjDesc->Region.Length = Table->Length;
657 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
659 ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
660 ObjDesc->Region.Length));
662 /* Now the address and length are valid for this opregion */
664 ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;
666 return_ACPI_STATUS (Status);
670 /*******************************************************************************
672 * FUNCTION: AcpiDsEvalDataObjectOperands
674 * PARAMETERS: WalkState - Current walk
675 * Op - A valid DataObject Op object
676 * ObjDesc - DataObject
680 * DESCRIPTION: Get the operands and complete the following data object types:
683 ******************************************************************************/
686 AcpiDsEvalDataObjectOperands (
687 ACPI_WALK_STATE *WalkState,
688 ACPI_PARSE_OBJECT *Op,
689 ACPI_OPERAND_OBJECT *ObjDesc)
692 ACPI_OPERAND_OBJECT *ArgDesc;
696 ACPI_FUNCTION_TRACE (DsEvalDataObjectOperands);
699 /* The first operand (for all of these data objects) is the length */
702 * Set proper index into operand stack for AcpiDsObjStackPush
703 * invoked inside AcpiDsCreateOperand.
705 WalkState->OperandIndex = WalkState->NumOperands;
707 Status = AcpiDsCreateOperand (WalkState, Op->Common.Value.Arg, 1);
708 if (ACPI_FAILURE (Status))
710 return_ACPI_STATUS (Status);
713 Status = AcpiExResolveOperands (WalkState->Opcode,
714 &(WalkState->Operands [WalkState->NumOperands -1]),
716 if (ACPI_FAILURE (Status))
718 return_ACPI_STATUS (Status);
721 /* Extract length operand */
723 ArgDesc = WalkState->Operands [WalkState->NumOperands - 1];
724 Length = (UINT32) ArgDesc->Integer.Value;
726 /* Cleanup for length operand */
728 Status = AcpiDsObjStackPop (1, WalkState);
729 if (ACPI_FAILURE (Status))
731 return_ACPI_STATUS (Status);
734 AcpiUtRemoveReference (ArgDesc);
737 * Create the actual data object
739 switch (Op->Common.AmlOpcode)
743 Status = AcpiDsBuildInternalBufferObj (WalkState, Op, Length, &ObjDesc);
747 case AML_VAR_PACKAGE_OP:
749 Status = AcpiDsBuildInternalPackageObj (WalkState, Op, Length, &ObjDesc);
754 return_ACPI_STATUS (AE_AML_BAD_OPCODE);
757 if (ACPI_SUCCESS (Status))
760 * Return the object in the WalkState, unless the parent is a package -
761 * in this case, the return object will be stored in the parse tree
764 if ((!Op->Common.Parent) ||
765 ((Op->Common.Parent->Common.AmlOpcode != AML_PACKAGE_OP) &&
766 (Op->Common.Parent->Common.AmlOpcode != AML_VAR_PACKAGE_OP) &&
767 (Op->Common.Parent->Common.AmlOpcode != AML_NAME_OP)))
769 WalkState->ResultObj = ObjDesc;
773 return_ACPI_STATUS (Status);
777 /*******************************************************************************
779 * FUNCTION: AcpiDsEvalBankFieldOperands
781 * PARAMETERS: WalkState - Current walk
782 * Op - A valid BankField Op object
786 * DESCRIPTION: Get BankField BankValue
787 * Called from AcpiDsExecEndOp during BankField parse tree walk
789 ******************************************************************************/
792 AcpiDsEvalBankFieldOperands (
793 ACPI_WALK_STATE *WalkState,
794 ACPI_PARSE_OBJECT *Op)
797 ACPI_OPERAND_OBJECT *ObjDesc;
798 ACPI_OPERAND_OBJECT *OperandDesc;
799 ACPI_NAMESPACE_NODE *Node;
800 ACPI_PARSE_OBJECT *NextOp;
801 ACPI_PARSE_OBJECT *Arg;
804 ACPI_FUNCTION_TRACE_PTR (DsEvalBankFieldOperands, Op);
808 * This is where we evaluate the BankValue field of the
809 * BankField declaration
812 /* NextOp points to the op that holds the Region */
814 NextOp = Op->Common.Value.Arg;
816 /* NextOp points to the op that holds the Bank Register */
818 NextOp = NextOp->Common.Next;
820 /* NextOp points to the op that holds the Bank Value */
822 NextOp = NextOp->Common.Next;
825 * Set proper index into operand stack for AcpiDsObjStackPush
826 * invoked inside AcpiDsCreateOperand.
828 * We use WalkState->Operands[0] to store the evaluated BankValue
830 WalkState->OperandIndex = 0;
832 Status = AcpiDsCreateOperand (WalkState, NextOp, 0);
833 if (ACPI_FAILURE (Status))
835 return_ACPI_STATUS (Status);
838 Status = AcpiExResolveToValue (&WalkState->Operands[0], WalkState);
839 if (ACPI_FAILURE (Status))
841 return_ACPI_STATUS (Status);
844 ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS,
845 AcpiPsGetOpcodeName (Op->Common.AmlOpcode), 1);
847 * Get the BankValue operand and save it
850 OperandDesc = WalkState->Operands[0];
852 /* Arg points to the start Bank Field */
854 Arg = AcpiPsGetArg (Op, 4);
857 /* Ignore OFFSET and ACCESSAS terms here */
859 if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
861 Node = Arg->Common.Node;
863 ObjDesc = AcpiNsGetAttachedObject (Node);
866 return_ACPI_STATUS (AE_NOT_EXIST);
869 ObjDesc->BankField.Value = (UINT32) OperandDesc->Integer.Value;
872 /* Move to next field in the list */
874 Arg = Arg->Common.Next;
877 AcpiUtRemoveReference (OperandDesc);
878 return_ACPI_STATUS (Status);