ReactOS  0.4.12-dev-712-ge6be187
dsopcode.c
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Module Name: dsopcode - Dispatcher support for regions and fields
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2019, Intel Corp.
9  * All rights reserved.
10  *
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.
25  *
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.
29  *
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.
42  */
43 
44 #include "acpi.h"
45 #include "accommon.h"
46 #include "acparser.h"
47 #include "amlcode.h"
48 #include "acdispat.h"
49 #include "acinterp.h"
50 #include "acnamesp.h"
51 #include "acevents.h"
52 #include "actables.h"
53 
54 #define _COMPONENT ACPI_DISPATCHER
55  ACPI_MODULE_NAME ("dsopcode")
56 
57 /* Local prototypes */
58 
59 static ACPI_STATUS
61  UINT16 AmlOpcode,
62  ACPI_OPERAND_OBJECT *ObjDesc,
63  ACPI_OPERAND_OBJECT *BufferDesc,
64  ACPI_OPERAND_OBJECT *OffsetDesc,
65  ACPI_OPERAND_OBJECT *LengthDesc,
66  ACPI_OPERAND_OBJECT *ResultDesc);
67 
68 
69 /*******************************************************************************
70  *
71  * FUNCTION: AcpiDsInitializeRegion
72  *
73  * PARAMETERS: ObjHandle - Region namespace node
74  *
75  * RETURN: Status
76  *
77  * DESCRIPTION: Front end to EvInitializeRegion
78  *
79  ******************************************************************************/
80 
83  ACPI_HANDLE ObjHandle)
84 {
85  ACPI_OPERAND_OBJECT *ObjDesc;
87 
88 
89  ObjDesc = AcpiNsGetAttachedObject (ObjHandle);
90 
91  /* Namespace is NOT locked */
92 
93  Status = AcpiEvInitializeRegion (ObjDesc);
94  return (Status);
95 }
96 
97 
98 /*******************************************************************************
99  *
100  * FUNCTION: AcpiDsInitBufferField
101  *
102  * PARAMETERS: AmlOpcode - CreateXxxField
103  * ObjDesc - BufferField object
104  * BufferDesc - Host Buffer
105  * OffsetDesc - Offset into buffer
106  * LengthDesc - Length of field (CREATE_FIELD_OP only)
107  * ResultDesc - Where to store the result
108  *
109  * RETURN: Status
110  *
111  * DESCRIPTION: Perform actual initialization of a buffer field
112  *
113  ******************************************************************************/
114 
115 static ACPI_STATUS
117  UINT16 AmlOpcode,
118  ACPI_OPERAND_OBJECT *ObjDesc,
119  ACPI_OPERAND_OBJECT *BufferDesc,
120  ACPI_OPERAND_OBJECT *OffsetDesc,
121  ACPI_OPERAND_OBJECT *LengthDesc,
122  ACPI_OPERAND_OBJECT *ResultDesc)
123 {
124  UINT32 Offset;
125  UINT32 BitOffset;
126  UINT32 BitCount;
127  UINT8 FieldFlags;
129 
130 
131  ACPI_FUNCTION_TRACE_PTR (DsInitBufferField, ObjDesc);
132 
133 
134  /* Host object must be a Buffer */
135 
136  if (BufferDesc->Common.Type != ACPI_TYPE_BUFFER)
137  {
139  "Target of Create Field is not a Buffer object - %s",
140  AcpiUtGetObjectTypeName (BufferDesc)));
141 
143  goto Cleanup;
144  }
145 
146  /*
147  * The last parameter to all of these opcodes (ResultDesc) started
148  * out as a NameString, and should therefore now be a NS node
149  * after resolution in AcpiExResolveOperands().
150  */
152  {
154  "(%s) destination not a NS Node [%s]",
155  AcpiPsGetOpcodeName (AmlOpcode),
156  AcpiUtGetDescriptorName (ResultDesc)));
157 
159  goto Cleanup;
160  }
161 
162  Offset = (UINT32) OffsetDesc->Integer.Value;
163 
164  /*
165  * Setup the Bit offsets and counts, according to the opcode
166  */
167  switch (AmlOpcode)
168  {
169  case AML_CREATE_FIELD_OP:
170 
171  /* Offset is in bits, count is in bits */
172 
173  FieldFlags = AML_FIELD_ACCESS_BYTE;
174  BitOffset = Offset;
175  BitCount = (UINT32) LengthDesc->Integer.Value;
176 
177  /* Must have a valid (>0) bit count */
178 
179  if (BitCount == 0)
180  {
182  "Attempt to CreateField of length zero"));
184  goto Cleanup;
185  }
186  break;
187 
189 
190  /* Offset is in bits, Field is one bit */
191 
192  BitOffset = Offset;
193  BitCount = 1;
194  FieldFlags = AML_FIELD_ACCESS_BYTE;
195  break;
196 
198 
199  /* Offset is in bytes, field is one byte */
200 
201  BitOffset = 8 * Offset;
202  BitCount = 8;
203  FieldFlags = AML_FIELD_ACCESS_BYTE;
204  break;
205 
207 
208  /* Offset is in bytes, field is one word */
209 
210  BitOffset = 8 * Offset;
211  BitCount = 16;
212  FieldFlags = AML_FIELD_ACCESS_WORD;
213  break;
214 
216 
217  /* Offset is in bytes, field is one dword */
218 
219  BitOffset = 8 * Offset;
220  BitCount = 32;
221  FieldFlags = AML_FIELD_ACCESS_DWORD;
222  break;
223 
225 
226  /* Offset is in bytes, field is one qword */
227 
228  BitOffset = 8 * Offset;
229  BitCount = 64;
230  FieldFlags = AML_FIELD_ACCESS_QWORD;
231  break;
232 
233  default:
234 
236  "Unknown field creation opcode 0x%02X",
237  AmlOpcode));
239  goto Cleanup;
240  }
241 
242  /* Entire field must fit within the current length of the buffer */
243 
244  if ((BitOffset + BitCount) >
245  (8 * (UINT32) BufferDesc->Buffer.Length))
246  {
249  "Field [%4.4s] at bit offset/length %u/%u "
250  "exceeds size of target Buffer (%u bits)",
251  AcpiUtGetNodeName (ResultDesc), BitOffset, BitCount,
252  8 * (UINT32) BufferDesc->Buffer.Length));
253  goto Cleanup;
254  }
255 
256  /*
257  * Initialize areas of the field object that are common to all fields
258  * For FieldFlags, use LOCK_RULE = 0 (NO_LOCK),
259  * UPDATE_RULE = 0 (UPDATE_PRESERVE)
260  */
262  ObjDesc, FieldFlags, 0, BitOffset, BitCount);
263  if (ACPI_FAILURE (Status))
264  {
265  goto Cleanup;
266  }
267 
268  ObjDesc->BufferField.BufferObj = BufferDesc;
269 
270  /* Reference count for BufferDesc inherits ObjDesc count */
271 
272  BufferDesc->Common.ReferenceCount = (UINT16)
273  (BufferDesc->Common.ReferenceCount + ObjDesc->Common.ReferenceCount);
274 
275 
276 Cleanup:
277 
278  /* Always delete the operands */
279 
280  AcpiUtRemoveReference (OffsetDesc);
281  AcpiUtRemoveReference (BufferDesc);
282 
283  if (AmlOpcode == AML_CREATE_FIELD_OP)
284  {
285  AcpiUtRemoveReference (LengthDesc);
286  }
287 
288  /* On failure, delete the result descriptor */
289 
290  if (ACPI_FAILURE (Status))
291  {
292  AcpiUtRemoveReference (ResultDesc); /* Result descriptor */
293  }
294  else
295  {
296  /* Now the address and length are valid for this BufferField */
297 
298  ObjDesc->BufferField.Flags |= AOPOBJ_DATA_VALID;
299  }
300 
302 }
303 
304 
305 /*******************************************************************************
306  *
307  * FUNCTION: AcpiDsEvalBufferFieldOperands
308  *
309  * PARAMETERS: WalkState - Current walk
310  * Op - A valid BufferField Op object
311  *
312  * RETURN: Status
313  *
314  * DESCRIPTION: Get BufferField Buffer and Index
315  * Called from AcpiDsExecEndOp during BufferField parse tree walk
316  *
317  ******************************************************************************/
318 
321  ACPI_WALK_STATE *WalkState,
322  ACPI_PARSE_OBJECT *Op)
323 {
325  ACPI_OPERAND_OBJECT *ObjDesc;
327  ACPI_PARSE_OBJECT *NextOp;
328 
329 
330  ACPI_FUNCTION_TRACE_PTR (DsEvalBufferFieldOperands, Op);
331 
332 
333  /*
334  * This is where we evaluate the address and length fields of the
335  * CreateXxxField declaration
336  */
337  Node = Op->Common.Node;
338 
339  /* NextOp points to the op that holds the Buffer */
340 
341  NextOp = Op->Common.Value.Arg;
342 
343  /* Evaluate/create the address and length operands */
344 
345  Status = AcpiDsCreateOperands (WalkState, NextOp);
346  if (ACPI_FAILURE (Status))
347  {
349  }
350 
351  ObjDesc = AcpiNsGetAttachedObject (Node);
352  if (!ObjDesc)
353  {
355  }
356 
357  /* Resolve the operands */
358 
360  Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState);
361  if (ACPI_FAILURE (Status))
362  {
363  ACPI_ERROR ((AE_INFO, "(%s) bad operand(s), status 0x%X",
364  AcpiPsGetOpcodeName (Op->Common.AmlOpcode), Status));
365 
367  }
368 
369  /* Initialize the Buffer Field */
370 
371  if (Op->Common.AmlOpcode == AML_CREATE_FIELD_OP)
372  {
373  /* NOTE: Slightly different operands for this opcode */
374 
375  Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc,
376  WalkState->Operands[0], WalkState->Operands[1],
377  WalkState->Operands[2], WalkState->Operands[3]);
378  }
379  else
380  {
381  /* All other, CreateXxxField opcodes */
382 
383  Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc,
384  WalkState->Operands[0], WalkState->Operands[1],
385  NULL, WalkState->Operands[2]);
386  }
387 
389 }
390 
391 
392 /*******************************************************************************
393  *
394  * FUNCTION: AcpiDsEvalRegionOperands
395  *
396  * PARAMETERS: WalkState - Current walk
397  * Op - A valid region Op object
398  *
399  * RETURN: Status
400  *
401  * DESCRIPTION: Get region address and length
402  * Called from AcpiDsExecEndOp during OpRegion parse tree walk
403  *
404  ******************************************************************************/
405 
408  ACPI_WALK_STATE *WalkState,
409  ACPI_PARSE_OBJECT *Op)
410 {
412  ACPI_OPERAND_OBJECT *ObjDesc;
413  ACPI_OPERAND_OBJECT *OperandDesc;
415  ACPI_PARSE_OBJECT *NextOp;
417 
418 
419  ACPI_FUNCTION_TRACE_PTR (DsEvalRegionOperands, Op);
420 
421 
422  /*
423  * This is where we evaluate the address and length fields of the
424  * OpRegion declaration
425  */
426  Node = Op->Common.Node;
427 
428  /* NextOp points to the op that holds the SpaceID */
429 
430  NextOp = Op->Common.Value.Arg;
431  SpaceId = (ACPI_ADR_SPACE_TYPE) NextOp->Common.Value.Integer;
432 
433  /* NextOp points to address op */
434 
435  NextOp = NextOp->Common.Next;
436 
437  /* Evaluate/create the address and length operands */
438 
439  Status = AcpiDsCreateOperands (WalkState, NextOp);
440  if (ACPI_FAILURE (Status))
441  {
443  }
444 
445  /* Resolve the length and address operands to numbers */
446 
448  Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState);
449  if (ACPI_FAILURE (Status))
450  {
452  }
453 
454  ObjDesc = AcpiNsGetAttachedObject (Node);
455  if (!ObjDesc)
456  {
458  }
459 
460  /*
461  * Get the length operand and save it
462  * (at Top of stack)
463  */
464  OperandDesc = WalkState->Operands[WalkState->NumOperands - 1];
465 
466  ObjDesc->Region.Length = (UINT32) OperandDesc->Integer.Value;
467  AcpiUtRemoveReference (OperandDesc);
468 
469  /* A zero-length operation region is unusable. Just warn */
470 
471  if (!ObjDesc->Region.Length && (SpaceId < ACPI_NUM_PREDEFINED_REGIONS))
472  {
474  "Operation Region [%4.4s] has zero length (SpaceId %X)",
475  Node->Name.Ascii, SpaceId));
476  }
477 
478  /*
479  * Get the address and save it
480  * (at top of stack - 1)
481  */
482  OperandDesc = WalkState->Operands[WalkState->NumOperands - 2];
483 
484  ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS)
485  OperandDesc->Integer.Value;
486  AcpiUtRemoveReference (OperandDesc);
487 
488  ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
489  ObjDesc, ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
490  ObjDesc->Region.Length));
491 
493  ObjDesc->Region.Address, ObjDesc->Region.Length, Node);
494 
495  /* Now the address and length are valid for this opregion */
496 
497  ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;
499 }
500 
501 
502 /*******************************************************************************
503  *
504  * FUNCTION: AcpiDsEvalTableRegionOperands
505  *
506  * PARAMETERS: WalkState - Current walk
507  * Op - A valid region Op object
508  *
509  * RETURN: Status
510  *
511  * DESCRIPTION: Get region address and length.
512  * Called from AcpiDsExecEndOp during DataTableRegion parse
513  * tree walk.
514  *
515  ******************************************************************************/
516 
519  ACPI_WALK_STATE *WalkState,
520  ACPI_PARSE_OBJECT *Op)
521 {
523  ACPI_OPERAND_OBJECT *ObjDesc;
524  ACPI_OPERAND_OBJECT **Operand;
526  ACPI_PARSE_OBJECT *NextOp;
528  UINT32 TableIndex;
529 
530 
531  ACPI_FUNCTION_TRACE_PTR (DsEvalTableRegionOperands, Op);
532 
533 
534  /*
535  * This is where we evaluate the Signature string, OemId string,
536  * and OemTableId string of the Data Table Region declaration
537  */
538  Node = Op->Common.Node;
539 
540  /* NextOp points to Signature string op */
541 
542  NextOp = Op->Common.Value.Arg;
543 
544  /*
545  * Evaluate/create the Signature string, OemId string,
546  * and OemTableId string operands
547  */
548  Status = AcpiDsCreateOperands (WalkState, NextOp);
549  if (ACPI_FAILURE (Status))
550  {
552  }
553 
554  Operand = &WalkState->Operands[0];
555 
556  /*
557  * Resolve the Signature string, OemId string,
558  * and OemTableId string operands
559  */
561  Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState);
562  if (ACPI_FAILURE (Status))
563  {
564  goto Cleanup;
565  }
566 
567  /* Find the ACPI table */
568 
570  Operand[0]->String.Pointer,
571  Operand[1]->String.Pointer,
572  Operand[2]->String.Pointer, &TableIndex);
573  if (ACPI_FAILURE (Status))
574  {
575  if (Status == AE_NOT_FOUND)
576  {
578  "ACPI Table [%4.4s] OEM:(%s, %s) not found in RSDT/XSDT",
579  Operand[0]->String.Pointer,
580  Operand[1]->String.Pointer,
581  Operand[2]->String.Pointer));
582  }
583  goto Cleanup;
584  }
585 
586  Status = AcpiGetTableByIndex (TableIndex, &Table);
587  if (ACPI_FAILURE (Status))
588  {
589  goto Cleanup;
590  }
591 
592  ObjDesc = AcpiNsGetAttachedObject (Node);
593  if (!ObjDesc)
594  {
596  goto Cleanup;
597  }
598 
600  ObjDesc->Region.Length = Table->Length;
601 
602  ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
603  ObjDesc, ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
604  ObjDesc->Region.Length));
605 
606  /* Now the address and length are valid for this opregion */
607 
608  ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;
609 
610 Cleanup:
611  AcpiUtRemoveReference (Operand[0]);
612  AcpiUtRemoveReference (Operand[1]);
613  AcpiUtRemoveReference (Operand[2]);
614 
616 }
617 
618 
619 /*******************************************************************************
620  *
621  * FUNCTION: AcpiDsEvalDataObjectOperands
622  *
623  * PARAMETERS: WalkState - Current walk
624  * Op - A valid DataObject Op object
625  * ObjDesc - DataObject
626  *
627  * RETURN: Status
628  *
629  * DESCRIPTION: Get the operands and complete the following data object types:
630  * Buffer, Package.
631  *
632  ******************************************************************************/
633 
636  ACPI_WALK_STATE *WalkState,
637  ACPI_PARSE_OBJECT *Op,
638  ACPI_OPERAND_OBJECT *ObjDesc)
639 {
641  ACPI_OPERAND_OBJECT *ArgDesc;
642  UINT32 Length;
643 
644 
645  ACPI_FUNCTION_TRACE (DsEvalDataObjectOperands);
646 
647 
648  /* The first operand (for all of these data objects) is the length */
649 
650  /*
651  * Set proper index into operand stack for AcpiDsObjStackPush
652  * invoked inside AcpiDsCreateOperand.
653  */
654  WalkState->OperandIndex = WalkState->NumOperands;
655 
656  /* Ignore if child is not valid */
657 
658  if (!Op->Common.Value.Arg)
659  {
661  "Missing child while evaluating opcode %4.4X, Op %p",
662  Op->Common.AmlOpcode, Op));
664  }
665 
666  Status = AcpiDsCreateOperand (WalkState, Op->Common.Value.Arg, 1);
667  if (ACPI_FAILURE (Status))
668  {
670  }
671 
672  Status = AcpiExResolveOperands (WalkState->Opcode,
673  &(WalkState->Operands [WalkState->NumOperands -1]),
674  WalkState);
675  if (ACPI_FAILURE (Status))
676  {
678  }
679 
680  /* Extract length operand */
681 
682  ArgDesc = WalkState->Operands [WalkState->NumOperands - 1];
683  Length = (UINT32) ArgDesc->Integer.Value;
684 
685  /* Cleanup for length operand */
686 
687  Status = AcpiDsObjStackPop (1, WalkState);
688  if (ACPI_FAILURE (Status))
689  {
691  }
692 
693  AcpiUtRemoveReference (ArgDesc);
694 
695  /*
696  * Create the actual data object
697  */
698  switch (Op->Common.AmlOpcode)
699  {
700  case AML_BUFFER_OP:
701 
703  WalkState, Op, Length, &ObjDesc);
704  break;
705 
706  case AML_PACKAGE_OP:
708 
710  WalkState, Op, Length, &ObjDesc);
711  break;
712 
713  default:
714 
716  }
717 
718  if (ACPI_SUCCESS (Status))
719  {
720  /*
721  * Return the object in the WalkState, unless the parent is a package -
722  * in this case, the return object will be stored in the parse tree
723  * for the package.
724  */
725  if ((!Op->Common.Parent) ||
726  ((Op->Common.Parent->Common.AmlOpcode != AML_PACKAGE_OP) &&
727  (Op->Common.Parent->Common.AmlOpcode != AML_VARIABLE_PACKAGE_OP) &&
728  (Op->Common.Parent->Common.AmlOpcode != AML_NAME_OP)))
729  {
730  WalkState->ResultObj = ObjDesc;
731  }
732  }
733 
735 }
736 
737 
738 /*******************************************************************************
739  *
740  * FUNCTION: AcpiDsEvalBankFieldOperands
741  *
742  * PARAMETERS: WalkState - Current walk
743  * Op - A valid BankField Op object
744  *
745  * RETURN: Status
746  *
747  * DESCRIPTION: Get BankField BankValue
748  * Called from AcpiDsExecEndOp during BankField parse tree walk
749  *
750  ******************************************************************************/
751 
754  ACPI_WALK_STATE *WalkState,
755  ACPI_PARSE_OBJECT *Op)
756 {
758  ACPI_OPERAND_OBJECT *ObjDesc;
759  ACPI_OPERAND_OBJECT *OperandDesc;
761  ACPI_PARSE_OBJECT *NextOp;
762  ACPI_PARSE_OBJECT *Arg;
763 
764 
765  ACPI_FUNCTION_TRACE_PTR (DsEvalBankFieldOperands, Op);
766 
767 
768  /*
769  * This is where we evaluate the BankValue field of the
770  * BankField declaration
771  */
772 
773  /* NextOp points to the op that holds the Region */
774 
775  NextOp = Op->Common.Value.Arg;
776 
777  /* NextOp points to the op that holds the Bank Register */
778 
779  NextOp = NextOp->Common.Next;
780 
781  /* NextOp points to the op that holds the Bank Value */
782 
783  NextOp = NextOp->Common.Next;
784 
785  /*
786  * Set proper index into operand stack for AcpiDsObjStackPush
787  * invoked inside AcpiDsCreateOperand.
788  *
789  * We use WalkState->Operands[0] to store the evaluated BankValue
790  */
791  WalkState->OperandIndex = 0;
792 
793  Status = AcpiDsCreateOperand (WalkState, NextOp, 0);
794  if (ACPI_FAILURE (Status))
795  {
797  }
798 
799  Status = AcpiExResolveToValue (&WalkState->Operands[0], WalkState);
800  if (ACPI_FAILURE (Status))
801  {
803  }
804 
806  AcpiPsGetOpcodeName (Op->Common.AmlOpcode), 1);
807  /*
808  * Get the BankValue operand and save it
809  * (at Top of stack)
810  */
811  OperandDesc = WalkState->Operands[0];
812 
813  /* Arg points to the start Bank Field */
814 
815  Arg = AcpiPsGetArg (Op, 4);
816  while (Arg)
817  {
818  /* Ignore OFFSET and ACCESSAS terms here */
819 
820  if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
821  {
822  Node = Arg->Common.Node;
823 
824  ObjDesc = AcpiNsGetAttachedObject (Node);
825  if (!ObjDesc)
826  {
828  }
829 
830  ObjDesc->BankField.Value = (UINT32) OperandDesc->Integer.Value;
831  }
832 
833  /* Move to next field in the list */
834 
835  Arg = Arg->Common.Next;
836  }
837 
838  AcpiUtRemoveReference (OperandDesc);
840 }
ACPI_STATUS AcpiDsCreateOperands(ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *FirstArg)
Definition: dsutils.c:753
#define AE_AML_BUFFER_LIMIT
Definition: acexcep.h:189
ACPI_STATUS AcpiDsEvalRegionOperands(ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op)
Definition: dsopcode.c:407
const char * AcpiUtGetDescriptorName(void *Object)
Definition: utdecode.c:381
ACPI_STATUS AcpiEvInitializeRegion(ACPI_OPERAND_OBJECT *RegionObj)
Definition: evrgnini.c:569
ACPI_PARSE_OBJ_COMMON Common
Definition: aclocal.h:1078
ASMGENDATA Table[]
Definition: genincdata.c:61
UINT8 ACPI_ADR_SPACE_TYPE
Definition: actypes.h:849
const char * AcpiPsGetOpcodeName(UINT16 Opcode)
Definition: psopinfo.c:169
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
#define AML_CREATE_WORD_FIELD_OP
Definition: amlcode.h:115
UINT8 OperandIndex
Definition: acstruct.h:81
#define AML_CREATE_BYTE_FIELD_OP
Definition: amlcode.h:116
#define ACPI_WARNING(plist)
Definition: acoutput.h:238
UINT8 NumOperands
Definition: acstruct.h:80
ACPI_STATUS AcpiDsBuildInternalPackageObj(ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op, UINT32 ElementCount, ACPI_OPERAND_OBJECT **ObjDescPtr)
Definition: dspkginit.c:94
#define ACPI_TYPE_BUFFER
Definition: actypes.h:681
#define AE_AML_OPERAND_VALUE
Definition: acexcep.h:183
ACPI_STATUS AcpiDsBuildInternalBufferObj(ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op, UINT32 BufferLength, ACPI_OPERAND_OBJECT **ObjDescPtr)
Definition: dsobject.c:188
static WCHAR String[]
Definition: stringtable.c:55
#define ACPI_DUMP_OPERANDS(a, b, c)
Definition: acoutput.h:486
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_OBJECT_COMMON_HEADER UINT8 SpaceId
Definition: acobject.h:202
ACPI_STATUS AcpiDsCreateOperand(ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Arg, UINT32 ArgIndex)
Definition: dsutils.c:497
#define AE_AML_OPERAND_TYPE
Definition: acexcep.h:182
ACPI_STATUS AcpiDsObjStackPop(UINT32 PopCount, ACPI_WALK_STATE *WalkState)
Definition: dswstate.c:391
#define AML_VARIABLE_PACKAGE_OP
Definition: amlcode.h:63
ACPI_STATUS AcpiExPrepCommonFieldObject(ACPI_OPERAND_OBJECT *ObjDesc, UINT8 FieldFlags, UINT8 FieldAttribute, UINT32 FieldBitPosition, UINT32 FieldBitLength)
Definition: exprep.c:347
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define AML_NAME_OP
Definition: amlcode.h:54
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE SpaceId
Definition: acpixf.h:816
ACPI_STATUS AcpiGetTableByIndex(UINT32 TableIndex, ACPI_TABLE_HEADER **OutTable)
Definition: tbxface.c:491
ACPI_OBJECT_BANK_FIELD BankField
Definition: acobject.h:533
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
unsigned int UINT32
union node Node
Definition: types.h:1255
ACPI_STATUS AcpiDsEvalBufferFieldOperands(ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op)
Definition: dsopcode.c:320
#define AML_CREATE_FIELD_OP
Definition: amlcode.h:163
#define ACPI_MODULE_NAME(Name)
Definition: acoutput.h:216
smooth NULL
Definition: ftsmooth.c:416
#define AE_INFO
Definition: acoutput.h:230
#define AE_AML_BAD_OPCODE
Definition: acexcep.h:180
#define ACPI_BIOS_ERROR(plist)
Definition: acoutput.h:243
switch(r->id)
Definition: btrfs.c:2691
ACPI_OBJECT_REGION Region
Definition: acobject.h:524
#define ACPI_FUNCTION_TRACE_PTR(a, b)
Definition: acoutput.h:481
ACPI_STATUS AcpiUtAddAddressRange(ACPI_ADR_SPACE_TYPE SpaceId, ACPI_PHYSICAL_ADDRESS Address, UINT32 Length, ACPI_NAMESPACE_NODE *RegionNode)
Definition: utaddress.c:78
ACPI_STATUS AcpiDsEvalBankFieldOperands(ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op)
Definition: dsopcode.c:753
ACPI_OBJECT_BUFFER Buffer
Definition: acobject.h:519
union acpi_operand_object * ResultObj
Definition: acstruct.h:121
static ACPI_STATUS AcpiDsInitBufferField(UINT16 AmlOpcode, ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT *BufferDesc, ACPI_OPERAND_OBJECT *OffsetDesc, ACPI_OPERAND_OBJECT *LengthDesc, ACPI_OPERAND_OBJECT *ResultDesc)
Definition: dsopcode.c:116
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define ACPI_BIOS_EXCEPTION(plist)
Definition: acoutput.h:242
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ACPI_OPERAND_OBJECT * AcpiNsGetAttachedObject(ACPI_NAMESPACE_NODE *Node)
Definition: nsobject.c:303
#define AE_NOT_FOUND
Definition: acexcep.h:113
ACPI_STATUS AcpiDsEvalDataObjectOperands(ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op, ACPI_OPERAND_OBJECT *ObjDesc)
Definition: dsopcode.c:635
#define AML_CREATE_BIT_FIELD_OP
Definition: amlcode.h:117
#define AE_NOT_EXIST
Definition: acexcep.h:114
ACPI_STATUS AcpiDsEvalTableRegionOperands(ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op)
Definition: dsopcode.c:518
#define ACPI_PTR_TO_PHYSADDR(i)
Definition: actypes.h:556
ACPI_OBJECT_INTEGER Integer
Definition: acobject.h:517
ACPI_STATUS AcpiExResolveToValue(ACPI_OPERAND_OBJECT **StackPtr, ACPI_WALK_STATE *WalkState)
Definition: exresolv.c:79
static const WCHAR Cleanup[]
Definition: register.c:80
#define AML_CREATE_QWORD_FIELD_OP
Definition: amlcode.h:119
ACPI_OBJECT_STRING String
Definition: acobject.h:518
#define AML_INT_NAMEDFIELD_OP
Definition: amlcode.h:206
#define AML_CREATE_DWORD_FIELD_OP
Definition: amlcode.h:114
Status
Definition: gdiplustypes.h:24
union acpi_operand_object * Operands[ACPI_OBJ_NUM_OPERANDS+1]
Definition: acstruct.h:105
#define ACPI_DB_EXEC
Definition: acoutput.h:165
ACPI_STATUS AcpiDsInitializeRegion(ACPI_HANDLE ObjHandle)
Definition: dsopcode.c:82
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_FORMAT_UINT64(i)
Definition: acmacros.h:71
ACPI_OBJECT_COMMON Common
Definition: acobject.h:516
void AcpiUtRemoveReference(ACPI_OPERAND_OBJECT *Object)
Definition: utdelete.c:784
unsigned short UINT16
ACPI_PARSE_OBJECT * AcpiPsGetArg(ACPI_PARSE_OBJECT *op, UINT32 argn)
Definition: pstree.c:76
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
const char * AcpiUtGetNodeName(void *Object)
Definition: utdecode.c:305
#define AOPOBJ_DATA_VALID
Definition: acobject.h:96
ACPI_PHYSICAL_ADDRESS Address
Definition: acobject.h:206
ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object * BufferObj
Definition: acobject.h:384
#define AML_BUFFER_OP
Definition: amlcode.h:61
UINT16 Opcode
Definition: acstruct.h:78
ACPI_OBJECT_BUFFER_FIELD BufferField
Definition: acobject.h:532
#define ACPI_DESC_TYPE_NAMED
Definition: acobject.h:574
#define ACPI_NUM_PREDEFINED_REGIONS
Definition: actypes.h:863
ACPI_STATUS AcpiExResolveOperands(UINT16 Opcode, ACPI_OPERAND_OBJECT **StackPtr, ACPI_WALK_STATE *WalkState)
Definition: exresop.c:145
#define ACPI_WALK_OPERANDS
Definition: acinterp.h:48
unsigned char UINT8
const char * AcpiUtGetObjectTypeName(ACPI_OPERAND_OBJECT *ObjDesc)
Definition: utdecode.c:263
#define AE_OK
Definition: acexcep.h:97
#define AML_PACKAGE_OP
Definition: amlcode.h:62
ACPI_STATUS AcpiTbFindTable(char *Signature, char *OemId, char *OemTableId, UINT32 *TableIndex)
Definition: tbfind.c:70
Definition: dlist.c:348
#define ACPI_GET_DESCRIPTOR_TYPE(d)
Definition: acmacros.h:414