Indentation fix, cleanup.
[AROS.git] / arch / all-pc / acpica / source / components / dispatcher / dsopcode.c
blob63c20a3ef8b5f835f54b0e3679c8e67da4e4c3a7
1 /******************************************************************************
3 * Module Name: dsopcode - Dispatcher support for regions and fields
5 *****************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2013, Intel Corp.
9 * All rights reserved.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
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.
30 * NO WARRANTY
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 __DSOPCODE_C__
46 #include "acpi.h"
47 #include "accommon.h"
48 #include "acparser.h"
49 #include "amlcode.h"
50 #include "acdispat.h"
51 #include "acinterp.h"
52 #include "acnamesp.h"
53 #include "acevents.h"
54 #include "actables.h"
56 #define _COMPONENT ACPI_DISPATCHER
57 ACPI_MODULE_NAME ("dsopcode")
59 /* Local prototypes */
61 static ACPI_STATUS
62 AcpiDsInitBufferField (
63 UINT16 AmlOpcode,
64 ACPI_OPERAND_OBJECT *ObjDesc,
65 ACPI_OPERAND_OBJECT *BufferDesc,
66 ACPI_OPERAND_OBJECT *OffsetDesc,
67 ACPI_OPERAND_OBJECT *LengthDesc,
68 ACPI_OPERAND_OBJECT *ResultDesc);
71 /*******************************************************************************
73 * FUNCTION: AcpiDsInitializeRegion
75 * PARAMETERS: ObjHandle - Region namespace node
77 * RETURN: Status
79 * DESCRIPTION: Front end to EvInitializeRegion
81 ******************************************************************************/
83 ACPI_STATUS
84 AcpiDsInitializeRegion (
85 ACPI_HANDLE ObjHandle)
87 ACPI_OPERAND_OBJECT *ObjDesc;
88 ACPI_STATUS Status;
91 ObjDesc = AcpiNsGetAttachedObject (ObjHandle);
93 /* Namespace is NOT locked */
95 Status = AcpiEvInitializeRegion (ObjDesc, FALSE);
96 return (Status);
100 /*******************************************************************************
102 * FUNCTION: AcpiDsInitBufferField
104 * PARAMETERS: AmlOpcode - CreateXxxField
105 * ObjDesc - BufferField object
106 * BufferDesc - Host Buffer
107 * OffsetDesc - Offset into buffer
108 * LengthDesc - Length of field (CREATE_FIELD_OP only)
109 * ResultDesc - Where to store the result
111 * RETURN: Status
113 * DESCRIPTION: Perform actual initialization of a buffer field
115 ******************************************************************************/
117 static ACPI_STATUS
118 AcpiDsInitBufferField (
119 UINT16 AmlOpcode,
120 ACPI_OPERAND_OBJECT *ObjDesc,
121 ACPI_OPERAND_OBJECT *BufferDesc,
122 ACPI_OPERAND_OBJECT *OffsetDesc,
123 ACPI_OPERAND_OBJECT *LengthDesc,
124 ACPI_OPERAND_OBJECT *ResultDesc)
126 UINT32 Offset;
127 UINT32 BitOffset;
128 UINT32 BitCount;
129 UINT8 FieldFlags;
130 ACPI_STATUS Status;
133 ACPI_FUNCTION_TRACE_PTR (DsInitBufferField, ObjDesc);
136 /* Host object must be a Buffer */
138 if (BufferDesc->Common.Type != ACPI_TYPE_BUFFER)
140 ACPI_ERROR ((AE_INFO,
141 "Target of Create Field is not a Buffer object - %s",
142 AcpiUtGetObjectTypeName (BufferDesc)));
144 Status = AE_AML_OPERAND_TYPE;
145 goto Cleanup;
149 * The last parameter to all of these opcodes (ResultDesc) started
150 * out as a NameString, and should therefore now be a NS node
151 * after resolution in AcpiExResolveOperands().
153 if (ACPI_GET_DESCRIPTOR_TYPE (ResultDesc) != ACPI_DESC_TYPE_NAMED)
155 ACPI_ERROR ((AE_INFO,
156 "(%s) destination not a NS Node [%s]",
157 AcpiPsGetOpcodeName (AmlOpcode),
158 AcpiUtGetDescriptorName (ResultDesc)));
160 Status = AE_AML_OPERAND_TYPE;
161 goto Cleanup;
164 Offset = (UINT32) OffsetDesc->Integer.Value;
167 * Setup the Bit offsets and counts, according to the opcode
169 switch (AmlOpcode)
171 case AML_CREATE_FIELD_OP:
173 /* Offset is in bits, count is in bits */
175 FieldFlags = AML_FIELD_ACCESS_BYTE;
176 BitOffset = Offset;
177 BitCount = (UINT32) LengthDesc->Integer.Value;
179 /* Must have a valid (>0) bit count */
181 if (BitCount == 0)
183 ACPI_ERROR ((AE_INFO,
184 "Attempt to CreateField of length zero"));
185 Status = AE_AML_OPERAND_VALUE;
186 goto Cleanup;
188 break;
190 case AML_CREATE_BIT_FIELD_OP:
192 /* Offset is in bits, Field is one bit */
194 BitOffset = Offset;
195 BitCount = 1;
196 FieldFlags = AML_FIELD_ACCESS_BYTE;
197 break;
199 case AML_CREATE_BYTE_FIELD_OP:
201 /* Offset is in bytes, field is one byte */
203 BitOffset = 8 * Offset;
204 BitCount = 8;
205 FieldFlags = AML_FIELD_ACCESS_BYTE;
206 break;
208 case AML_CREATE_WORD_FIELD_OP:
210 /* Offset is in bytes, field is one word */
212 BitOffset = 8 * Offset;
213 BitCount = 16;
214 FieldFlags = AML_FIELD_ACCESS_WORD;
215 break;
217 case AML_CREATE_DWORD_FIELD_OP:
219 /* Offset is in bytes, field is one dword */
221 BitOffset = 8 * Offset;
222 BitCount = 32;
223 FieldFlags = AML_FIELD_ACCESS_DWORD;
224 break;
226 case AML_CREATE_QWORD_FIELD_OP:
228 /* Offset is in bytes, field is one qword */
230 BitOffset = 8 * Offset;
231 BitCount = 64;
232 FieldFlags = AML_FIELD_ACCESS_QWORD;
233 break;
235 default:
237 ACPI_ERROR ((AE_INFO,
238 "Unknown field creation opcode 0x%02X",
239 AmlOpcode));
240 Status = AE_AML_BAD_OPCODE;
241 goto Cleanup;
244 /* Entire field must fit within the current length of the buffer */
246 if ((BitOffset + BitCount) >
247 (8 * (UINT32) BufferDesc->Buffer.Length))
249 ACPI_ERROR ((AE_INFO,
250 "Field [%4.4s] at %u exceeds Buffer [%4.4s] size %u (bits)",
251 AcpiUtGetNodeName (ResultDesc),
252 BitOffset + BitCount,
253 AcpiUtGetNodeName (BufferDesc->Buffer.Node),
254 8 * (UINT32) BufferDesc->Buffer.Length));
255 Status = AE_AML_BUFFER_LIMIT;
256 goto Cleanup;
260 * Initialize areas of the field object that are common to all fields
261 * For FieldFlags, use LOCK_RULE = 0 (NO_LOCK),
262 * UPDATE_RULE = 0 (UPDATE_PRESERVE)
264 Status = AcpiExPrepCommonFieldObject (ObjDesc, FieldFlags, 0,
265 BitOffset, BitCount);
266 if (ACPI_FAILURE (Status))
268 goto Cleanup;
271 ObjDesc->BufferField.BufferObj = BufferDesc;
273 /* Reference count for BufferDesc inherits ObjDesc count */
275 BufferDesc->Common.ReferenceCount = (UINT16)
276 (BufferDesc->Common.ReferenceCount + ObjDesc->Common.ReferenceCount);
279 Cleanup:
281 /* Always delete the operands */
283 AcpiUtRemoveReference (OffsetDesc);
284 AcpiUtRemoveReference (BufferDesc);
286 if (AmlOpcode == AML_CREATE_FIELD_OP)
288 AcpiUtRemoveReference (LengthDesc);
291 /* On failure, delete the result descriptor */
293 if (ACPI_FAILURE (Status))
295 AcpiUtRemoveReference (ResultDesc); /* Result descriptor */
297 else
299 /* Now the address and length are valid for this BufferField */
301 ObjDesc->BufferField.Flags |= AOPOBJ_DATA_VALID;
304 return_ACPI_STATUS (Status);
308 /*******************************************************************************
310 * FUNCTION: AcpiDsEvalBufferFieldOperands
312 * PARAMETERS: WalkState - Current walk
313 * Op - A valid BufferField Op object
315 * RETURN: Status
317 * DESCRIPTION: Get BufferField Buffer and Index
318 * Called from AcpiDsExecEndOp during BufferField parse tree walk
320 ******************************************************************************/
322 ACPI_STATUS
323 AcpiDsEvalBufferFieldOperands (
324 ACPI_WALK_STATE *WalkState,
325 ACPI_PARSE_OBJECT *Op)
327 ACPI_STATUS Status;
328 ACPI_OPERAND_OBJECT *ObjDesc;
329 ACPI_NAMESPACE_NODE *Node;
330 ACPI_PARSE_OBJECT *NextOp;
333 ACPI_FUNCTION_TRACE_PTR (DsEvalBufferFieldOperands, Op);
337 * This is where we evaluate the address and length fields of the
338 * CreateXxxField declaration
340 Node = Op->Common.Node;
342 /* NextOp points to the op that holds the Buffer */
344 NextOp = Op->Common.Value.Arg;
346 /* Evaluate/create the address and length operands */
348 Status = AcpiDsCreateOperands (WalkState, NextOp);
349 if (ACPI_FAILURE (Status))
351 return_ACPI_STATUS (Status);
354 ObjDesc = AcpiNsGetAttachedObject (Node);
355 if (!ObjDesc)
357 return_ACPI_STATUS (AE_NOT_EXIST);
360 /* Resolve the operands */
362 Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
363 ACPI_WALK_OPERANDS, WalkState);
364 if (ACPI_FAILURE (Status))
366 ACPI_ERROR ((AE_INFO, "(%s) bad operand(s), status 0x%X",
367 AcpiPsGetOpcodeName (Op->Common.AmlOpcode), Status));
369 return_ACPI_STATUS (Status);
372 /* Initialize the Buffer Field */
374 if (Op->Common.AmlOpcode == AML_CREATE_FIELD_OP)
376 /* NOTE: Slightly different operands for this opcode */
378 Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc,
379 WalkState->Operands[0], WalkState->Operands[1],
380 WalkState->Operands[2], WalkState->Operands[3]);
382 else
384 /* All other, CreateXxxField opcodes */
386 Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc,
387 WalkState->Operands[0], WalkState->Operands[1],
388 NULL, WalkState->Operands[2]);
391 return_ACPI_STATUS (Status);
395 /*******************************************************************************
397 * FUNCTION: AcpiDsEvalRegionOperands
399 * PARAMETERS: WalkState - Current walk
400 * Op - A valid region Op object
402 * RETURN: Status
404 * DESCRIPTION: Get region address and length
405 * Called from AcpiDsExecEndOp during OpRegion parse tree walk
407 ******************************************************************************/
409 ACPI_STATUS
410 AcpiDsEvalRegionOperands (
411 ACPI_WALK_STATE *WalkState,
412 ACPI_PARSE_OBJECT *Op)
414 ACPI_STATUS Status;
415 ACPI_OPERAND_OBJECT *ObjDesc;
416 ACPI_OPERAND_OBJECT *OperandDesc;
417 ACPI_NAMESPACE_NODE *Node;
418 ACPI_PARSE_OBJECT *NextOp;
421 ACPI_FUNCTION_TRACE_PTR (DsEvalRegionOperands, Op);
425 * This is where we evaluate the address and length fields of the
426 * OpRegion declaration
428 Node = Op->Common.Node;
430 /* NextOp points to the op that holds the SpaceID */
432 NextOp = Op->Common.Value.Arg;
434 /* NextOp points to address op */
436 NextOp = NextOp->Common.Next;
438 /* Evaluate/create the address and length operands */
440 Status = AcpiDsCreateOperands (WalkState, NextOp);
441 if (ACPI_FAILURE (Status))
443 return_ACPI_STATUS (Status);
446 /* Resolve the length and address operands to numbers */
448 Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
449 ACPI_WALK_OPERANDS, WalkState);
450 if (ACPI_FAILURE (Status))
452 return_ACPI_STATUS (Status);
455 ObjDesc = AcpiNsGetAttachedObject (Node);
456 if (!ObjDesc)
458 return_ACPI_STATUS (AE_NOT_EXIST);
462 * Get the length operand and save it
463 * (at Top of stack)
465 OperandDesc = WalkState->Operands[WalkState->NumOperands - 1];
467 ObjDesc->Region.Length = (UINT32) OperandDesc->Integer.Value;
468 AcpiUtRemoveReference (OperandDesc);
471 * Get the address and save it
472 * (at top of stack - 1)
474 OperandDesc = WalkState->Operands[WalkState->NumOperands - 2];
476 ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS)
477 OperandDesc->Integer.Value;
478 AcpiUtRemoveReference (OperandDesc);
480 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
481 ObjDesc,
482 ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
483 ObjDesc->Region.Length));
485 /* Now the address and length are valid for this opregion */
487 ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;
489 return_ACPI_STATUS (Status);
493 /*******************************************************************************
495 * FUNCTION: AcpiDsEvalTableRegionOperands
497 * PARAMETERS: WalkState - Current walk
498 * Op - A valid region Op object
500 * RETURN: Status
502 * DESCRIPTION: Get region address and length.
503 * Called from AcpiDsExecEndOp during DataTableRegion parse
504 * tree walk.
506 ******************************************************************************/
508 ACPI_STATUS
509 AcpiDsEvalTableRegionOperands (
510 ACPI_WALK_STATE *WalkState,
511 ACPI_PARSE_OBJECT *Op)
513 ACPI_STATUS Status;
514 ACPI_OPERAND_OBJECT *ObjDesc;
515 ACPI_OPERAND_OBJECT **Operand;
516 ACPI_NAMESPACE_NODE *Node;
517 ACPI_PARSE_OBJECT *NextOp;
518 UINT32 TableIndex;
519 ACPI_TABLE_HEADER *Table;
522 ACPI_FUNCTION_TRACE_PTR (DsEvalTableRegionOperands, Op);
526 * This is where we evaluate the Signature string, OemId string,
527 * and OemTableId string of the Data Table Region declaration
529 Node = Op->Common.Node;
531 /* NextOp points to Signature string op */
533 NextOp = Op->Common.Value.Arg;
536 * Evaluate/create the Signature string, OemId string,
537 * and OemTableId string operands
539 Status = AcpiDsCreateOperands (WalkState, NextOp);
540 if (ACPI_FAILURE (Status))
542 return_ACPI_STATUS (Status);
546 * Resolve the Signature string, OemId string,
547 * and OemTableId string operands
549 Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
550 ACPI_WALK_OPERANDS, WalkState);
551 if (ACPI_FAILURE (Status))
553 return_ACPI_STATUS (Status);
556 Operand = &WalkState->Operands[0];
558 /* Find the ACPI table */
560 Status = AcpiTbFindTable (Operand[0]->String.Pointer,
561 Operand[1]->String.Pointer, Operand[2]->String.Pointer,
562 &TableIndex);
563 if (ACPI_FAILURE (Status))
565 return_ACPI_STATUS (Status);
568 AcpiUtRemoveReference (Operand[0]);
569 AcpiUtRemoveReference (Operand[1]);
570 AcpiUtRemoveReference (Operand[2]);
572 Status = AcpiGetTableByIndex (TableIndex, &Table);
573 if (ACPI_FAILURE (Status))
575 return_ACPI_STATUS (Status);
578 ObjDesc = AcpiNsGetAttachedObject (Node);
579 if (!ObjDesc)
581 return_ACPI_STATUS (AE_NOT_EXIST);
584 ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS) ACPI_TO_INTEGER (Table);
585 ObjDesc->Region.Length = Table->Length;
587 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
588 ObjDesc,
589 ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
590 ObjDesc->Region.Length));
592 /* Now the address and length are valid for this opregion */
594 ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;
596 return_ACPI_STATUS (Status);
600 /*******************************************************************************
602 * FUNCTION: AcpiDsEvalDataObjectOperands
604 * PARAMETERS: WalkState - Current walk
605 * Op - A valid DataObject Op object
606 * ObjDesc - DataObject
608 * RETURN: Status
610 * DESCRIPTION: Get the operands and complete the following data object types:
611 * Buffer, Package.
613 ******************************************************************************/
615 ACPI_STATUS
616 AcpiDsEvalDataObjectOperands (
617 ACPI_WALK_STATE *WalkState,
618 ACPI_PARSE_OBJECT *Op,
619 ACPI_OPERAND_OBJECT *ObjDesc)
621 ACPI_STATUS Status;
622 ACPI_OPERAND_OBJECT *ArgDesc;
623 UINT32 Length;
626 ACPI_FUNCTION_TRACE (DsEvalDataObjectOperands);
629 /* The first operand (for all of these data objects) is the length */
632 * Set proper index into operand stack for AcpiDsObjStackPush
633 * invoked inside AcpiDsCreateOperand.
635 WalkState->OperandIndex = WalkState->NumOperands;
637 Status = AcpiDsCreateOperand (WalkState, Op->Common.Value.Arg, 1);
638 if (ACPI_FAILURE (Status))
640 return_ACPI_STATUS (Status);
643 Status = AcpiExResolveOperands (WalkState->Opcode,
644 &(WalkState->Operands [WalkState->NumOperands -1]),
645 WalkState);
646 if (ACPI_FAILURE (Status))
648 return_ACPI_STATUS (Status);
651 /* Extract length operand */
653 ArgDesc = WalkState->Operands [WalkState->NumOperands - 1];
654 Length = (UINT32) ArgDesc->Integer.Value;
656 /* Cleanup for length operand */
658 Status = AcpiDsObjStackPop (1, WalkState);
659 if (ACPI_FAILURE (Status))
661 return_ACPI_STATUS (Status);
664 AcpiUtRemoveReference (ArgDesc);
667 * Create the actual data object
669 switch (Op->Common.AmlOpcode)
671 case AML_BUFFER_OP:
673 Status = AcpiDsBuildInternalBufferObj (WalkState, Op, Length, &ObjDesc);
674 break;
676 case AML_PACKAGE_OP:
677 case AML_VAR_PACKAGE_OP:
679 Status = AcpiDsBuildInternalPackageObj (WalkState, Op, Length, &ObjDesc);
680 break;
682 default:
684 return_ACPI_STATUS (AE_AML_BAD_OPCODE);
687 if (ACPI_SUCCESS (Status))
690 * Return the object in the WalkState, unless the parent is a package -
691 * in this case, the return object will be stored in the parse tree
692 * for the package.
694 if ((!Op->Common.Parent) ||
695 ((Op->Common.Parent->Common.AmlOpcode != AML_PACKAGE_OP) &&
696 (Op->Common.Parent->Common.AmlOpcode != AML_VAR_PACKAGE_OP) &&
697 (Op->Common.Parent->Common.AmlOpcode != AML_NAME_OP)))
699 WalkState->ResultObj = ObjDesc;
703 return_ACPI_STATUS (Status);
707 /*******************************************************************************
709 * FUNCTION: AcpiDsEvalBankFieldOperands
711 * PARAMETERS: WalkState - Current walk
712 * Op - A valid BankField Op object
714 * RETURN: Status
716 * DESCRIPTION: Get BankField BankValue
717 * Called from AcpiDsExecEndOp during BankField parse tree walk
719 ******************************************************************************/
721 ACPI_STATUS
722 AcpiDsEvalBankFieldOperands (
723 ACPI_WALK_STATE *WalkState,
724 ACPI_PARSE_OBJECT *Op)
726 ACPI_STATUS Status;
727 ACPI_OPERAND_OBJECT *ObjDesc;
728 ACPI_OPERAND_OBJECT *OperandDesc;
729 ACPI_NAMESPACE_NODE *Node;
730 ACPI_PARSE_OBJECT *NextOp;
731 ACPI_PARSE_OBJECT *Arg;
734 ACPI_FUNCTION_TRACE_PTR (DsEvalBankFieldOperands, Op);
738 * This is where we evaluate the BankValue field of the
739 * BankField declaration
742 /* NextOp points to the op that holds the Region */
744 NextOp = Op->Common.Value.Arg;
746 /* NextOp points to the op that holds the Bank Register */
748 NextOp = NextOp->Common.Next;
750 /* NextOp points to the op that holds the Bank Value */
752 NextOp = NextOp->Common.Next;
755 * Set proper index into operand stack for AcpiDsObjStackPush
756 * invoked inside AcpiDsCreateOperand.
758 * We use WalkState->Operands[0] to store the evaluated BankValue
760 WalkState->OperandIndex = 0;
762 Status = AcpiDsCreateOperand (WalkState, NextOp, 0);
763 if (ACPI_FAILURE (Status))
765 return_ACPI_STATUS (Status);
768 Status = AcpiExResolveToValue (&WalkState->Operands[0], WalkState);
769 if (ACPI_FAILURE (Status))
771 return_ACPI_STATUS (Status);
774 ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS,
775 AcpiPsGetOpcodeName (Op->Common.AmlOpcode), 1);
777 * Get the BankValue operand and save it
778 * (at Top of stack)
780 OperandDesc = WalkState->Operands[0];
782 /* Arg points to the start Bank Field */
784 Arg = AcpiPsGetArg (Op, 4);
785 while (Arg)
787 /* Ignore OFFSET and ACCESSAS terms here */
789 if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
791 Node = Arg->Common.Node;
793 ObjDesc = AcpiNsGetAttachedObject (Node);
794 if (!ObjDesc)
796 return_ACPI_STATUS (AE_NOT_EXIST);
799 ObjDesc->BankField.Value = (UINT32) OperandDesc->Integer.Value;
802 /* Move to next field in the list */
804 Arg = Arg->Common.Next;
807 AcpiUtRemoveReference (OperandDesc);
808 return_ACPI_STATUS (Status);