1 /******************************************************************************
3 * Module Name: dsfield - Dispatcher field routines
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2014, 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.
46 #include <contrib/dev/acpica/include/acpi.h>
47 #include <contrib/dev/acpica/include/accommon.h>
48 #include <contrib/dev/acpica/include/amlcode.h>
49 #include <contrib/dev/acpica/include/acdispat.h>
50 #include <contrib/dev/acpica/include/acinterp.h>
51 #include <contrib/dev/acpica/include/acnamesp.h>
52 #include <contrib/dev/acpica/include/acparser.h>
55 #define _COMPONENT ACPI_DISPATCHER
56 ACPI_MODULE_NAME ("dsfield")
58 /* Local prototypes */
60 #ifdef ACPI_ASL_COMPILER
61 #include <contrib/dev/acpica/include/acdisasm.h>
64 AcpiDsCreateExternalRegion (
65 ACPI_STATUS LookupStatus,
66 ACPI_PARSE_OBJECT *Op,
68 ACPI_WALK_STATE *WalkState,
69 ACPI_NAMESPACE_NODE **Node);
74 ACPI_CREATE_FIELD_INFO *Info,
75 ACPI_WALK_STATE *WalkState,
76 ACPI_PARSE_OBJECT *Arg);
79 #ifdef ACPI_ASL_COMPILER
80 /*******************************************************************************
82 * FUNCTION: AcpiDsCreateExternalRegion (iASL Disassembler only)
84 * PARAMETERS: LookupStatus - Status from NsLookup operation
85 * Op - Op containing the Field definition and args
86 * Path - Pathname of the region
87 * ` WalkState - Current method state
88 * Node - Where the new region node is returned
92 * DESCRIPTION: Add region to the external list if NOT_FOUND. Create a new
95 ******************************************************************************/
98 AcpiDsCreateExternalRegion (
99 ACPI_STATUS LookupStatus,
100 ACPI_PARSE_OBJECT *Op,
102 ACPI_WALK_STATE *WalkState,
103 ACPI_NAMESPACE_NODE **Node)
106 ACPI_OPERAND_OBJECT *ObjDesc;
109 if (LookupStatus != AE_NOT_FOUND)
111 return (LookupStatus);
116 * OperationRegion not found. Generate an External for it, and
117 * insert the name into the namespace.
119 AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_REGION, 0, 0);
120 Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_REGION,
121 ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, Node);
122 if (ACPI_FAILURE (Status))
127 /* Must create and install a region object for the new node */
129 ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION);
132 return (AE_NO_MEMORY);
135 ObjDesc->Region.Node = *Node;
136 Status = AcpiNsAttachObject (*Node, ObjDesc, ACPI_TYPE_REGION);
142 /*******************************************************************************
144 * FUNCTION: AcpiDsCreateBufferField
146 * PARAMETERS: Op - Current parse op (CreateXXField)
147 * WalkState - Current state
151 * DESCRIPTION: Execute the CreateField operators:
155 * CreateDwordFieldOp,
156 * CreateQwordFieldOp,
157 * CreateFieldOp (all of which define a field in a buffer)
159 ******************************************************************************/
162 AcpiDsCreateBufferField (
163 ACPI_PARSE_OBJECT *Op,
164 ACPI_WALK_STATE *WalkState)
166 ACPI_PARSE_OBJECT *Arg;
167 ACPI_NAMESPACE_NODE *Node;
169 ACPI_OPERAND_OBJECT *ObjDesc;
170 ACPI_OPERAND_OBJECT *SecondDesc = NULL;
174 ACPI_FUNCTION_TRACE (DsCreateBufferField);
178 * Get the NameString argument (name of the new BufferField)
180 if (Op->Common.AmlOpcode == AML_CREATE_FIELD_OP)
182 /* For CreateField, name is the 4th argument */
184 Arg = AcpiPsGetArg (Op, 3);
188 /* For all other CreateXXXField operators, name is the 3rd argument */
190 Arg = AcpiPsGetArg (Op, 2);
195 return_ACPI_STATUS (AE_AML_NO_OPERAND);
198 if (WalkState->DeferredNode)
200 Node = WalkState->DeferredNode;
205 /* Execute flag should always be set when this function is entered */
207 if (!(WalkState->ParseFlags & ACPI_PARSE_EXECUTE))
209 return_ACPI_STATUS (AE_AML_INTERNAL);
212 /* Creating new namespace node, should not already exist */
214 Flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
215 ACPI_NS_ERROR_IF_FOUND;
218 * Mark node temporary if we are executing a normal control
219 * method. (Don't mark if this is a module-level code method)
221 if (WalkState->MethodNode &&
222 !(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
224 Flags |= ACPI_NS_TEMPORARY;
227 /* Enter the NameString into the namespace */
229 Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
230 ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1,
231 Flags, WalkState, &Node);
232 if (ACPI_FAILURE (Status))
234 ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
235 return_ACPI_STATUS (Status);
240 * We could put the returned object (Node) on the object stack for later,
241 * but for now, we will put it in the "op" object that the parser uses,
242 * so we can get it again at the end of this scope.
244 Op->Common.Node = Node;
247 * If there is no object attached to the node, this node was just created
248 * and we need to create the field object. Otherwise, this was a lookup
249 * of an existing node and we don't want to create the field object again.
251 ObjDesc = AcpiNsGetAttachedObject (Node);
254 return_ACPI_STATUS (AE_OK);
258 * The Field definition is not fully parsed at this time.
259 * (We must save the address of the AML for the buffer and index operands)
262 /* Create the buffer field object */
264 ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER_FIELD);
267 Status = AE_NO_MEMORY;
272 * Remember location in AML stream of the field unit opcode and operands --
273 * since the buffer and index operands must be evaluated.
275 SecondDesc = ObjDesc->Common.NextObject;
276 SecondDesc->Extra.AmlStart = Op->Named.Data;
277 SecondDesc->Extra.AmlLength = Op->Named.Length;
278 ObjDesc->BufferField.Node = Node;
280 /* Attach constructed field descriptors to parent node */
282 Status = AcpiNsAttachObject (Node, ObjDesc, ACPI_TYPE_BUFFER_FIELD);
283 if (ACPI_FAILURE (Status))
291 /* Remove local reference to the object */
293 AcpiUtRemoveReference (ObjDesc);
294 return_ACPI_STATUS (Status);
298 /*******************************************************************************
300 * FUNCTION: AcpiDsGetFieldNames
302 * PARAMETERS: Info - CreateField info structure
303 * ` WalkState - Current method state
304 * Arg - First parser arg for the field name list
308 * DESCRIPTION: Process all named fields in a field declaration. Names are
309 * entered into the namespace.
311 ******************************************************************************/
314 AcpiDsGetFieldNames (
315 ACPI_CREATE_FIELD_INFO *Info,
316 ACPI_WALK_STATE *WalkState,
317 ACPI_PARSE_OBJECT *Arg)
321 ACPI_PARSE_OBJECT *Child;
324 ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info);
327 /* First field starts at bit zero */
329 Info->FieldBitPosition = 0;
331 /* Process all elements in the field list (of parse nodes) */
336 * Four types of field elements are handled:
337 * 1) Name - Enters a new named field into the namespace
338 * 2) Offset - specifies a bit offset
339 * 3) AccessAs - changes the access mode/attributes
340 * 4) Connection - Associate a resource template with the field
342 switch (Arg->Common.AmlOpcode)
344 case AML_INT_RESERVEDFIELD_OP:
346 Position = (UINT64) Info->FieldBitPosition
347 + (UINT64) Arg->Common.Value.Size;
349 if (Position > ACPI_UINT32_MAX)
351 ACPI_ERROR ((AE_INFO,
352 "Bit offset within field too large (> 0xFFFFFFFF)"));
353 return_ACPI_STATUS (AE_SUPPORT);
356 Info->FieldBitPosition = (UINT32) Position;
359 case AML_INT_ACCESSFIELD_OP:
360 case AML_INT_EXTACCESSFIELD_OP:
362 * Get new AccessType, AccessAttribute, and AccessLength fields
363 * -- to be used for all field units that follow, until the
364 * end-of-field or another AccessAs keyword is encountered.
365 * NOTE. These three bytes are encoded in the integer value
366 * of the parseop for convenience.
368 * In FieldFlags, preserve the flag bits other than the
372 /* AccessType (ByteAcc, WordAcc, etc.) */
374 Info->FieldFlags = (UINT8)
375 ((Info->FieldFlags & ~(AML_FIELD_ACCESS_TYPE_MASK)) |
376 ((UINT8) ((UINT32) (Arg->Common.Value.Integer & 0x07))));
378 /* AccessAttribute (AttribQuick, AttribByte, etc.) */
380 Info->Attribute = (UINT8) ((Arg->Common.Value.Integer >> 8) & 0xFF);
382 /* AccessLength (for serial/buffer protocols) */
384 Info->AccessLength = (UINT8) ((Arg->Common.Value.Integer >> 16) & 0xFF);
387 case AML_INT_CONNECTION_OP:
389 * Clear any previous connection. New connection is used for all
390 * fields that follow, similar to AccessAs
392 Info->ResourceBuffer = NULL;
393 Info->ConnectionNode = NULL;
394 Info->PinNumberIndex = 0;
397 * A Connection() is either an actual resource descriptor (buffer)
398 * or a named reference to a resource template
400 Child = Arg->Common.Value.Arg;
401 if (Child->Common.AmlOpcode == AML_INT_BYTELIST_OP)
403 Info->ResourceBuffer = Child->Named.Data;
404 Info->ResourceLength = (UINT16) Child->Named.Value.Integer;
408 /* Lookup the Connection() namepath, it should already exist */
410 Status = AcpiNsLookup (WalkState->ScopeInfo,
411 Child->Common.Value.Name, ACPI_TYPE_ANY,
412 ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
413 WalkState, &Info->ConnectionNode);
414 if (ACPI_FAILURE (Status))
416 ACPI_ERROR_NAMESPACE (Child->Common.Value.Name, Status);
417 return_ACPI_STATUS (Status);
422 case AML_INT_NAMEDFIELD_OP:
424 /* Lookup the name, it should already exist */
426 Status = AcpiNsLookup (WalkState->ScopeInfo,
427 (char *) &Arg->Named.Name, Info->FieldType,
428 ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
429 WalkState, &Info->FieldNode);
430 if (ACPI_FAILURE (Status))
432 ACPI_ERROR_NAMESPACE ((char *) &Arg->Named.Name, Status);
433 return_ACPI_STATUS (Status);
437 Arg->Common.Node = Info->FieldNode;
438 Info->FieldBitLength = Arg->Common.Value.Size;
441 * If there is no object attached to the node, this node was
442 * just created and we need to create the field object.
443 * Otherwise, this was a lookup of an existing node and we
444 * don't want to create the field object again.
446 if (!AcpiNsGetAttachedObject (Info->FieldNode))
448 Status = AcpiExPrepFieldValue (Info);
449 if (ACPI_FAILURE (Status))
451 return_ACPI_STATUS (Status);
456 /* Keep track of bit position for the next field */
458 Position = (UINT64) Info->FieldBitPosition
459 + (UINT64) Arg->Common.Value.Size;
461 if (Position > ACPI_UINT32_MAX)
463 ACPI_ERROR ((AE_INFO,
464 "Field [%4.4s] bit offset too large (> 0xFFFFFFFF)",
465 ACPI_CAST_PTR (char, &Info->FieldNode->Name)));
466 return_ACPI_STATUS (AE_SUPPORT);
469 Info->FieldBitPosition += Info->FieldBitLength;
470 Info->PinNumberIndex++; /* Index relative to previous Connection() */
475 ACPI_ERROR ((AE_INFO,
476 "Invalid opcode in field list: 0x%X", Arg->Common.AmlOpcode));
477 return_ACPI_STATUS (AE_AML_BAD_OPCODE);
480 Arg = Arg->Common.Next;
483 return_ACPI_STATUS (AE_OK);
487 /*******************************************************************************
489 * FUNCTION: AcpiDsCreateField
491 * PARAMETERS: Op - Op containing the Field definition and args
492 * RegionNode - Object for the containing Operation Region
493 * ` WalkState - Current method state
497 * DESCRIPTION: Create a new field in the specified operation region
499 ******************************************************************************/
503 ACPI_PARSE_OBJECT *Op,
504 ACPI_NAMESPACE_NODE *RegionNode,
505 ACPI_WALK_STATE *WalkState)
508 ACPI_PARSE_OBJECT *Arg;
509 ACPI_CREATE_FIELD_INFO Info;
512 ACPI_FUNCTION_TRACE_PTR (DsCreateField, Op);
515 /* First arg is the name of the parent OpRegion (must already exist) */
517 Arg = Op->Common.Value.Arg;
521 Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name,
522 ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
523 ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
524 #ifdef ACPI_ASL_COMPILER
525 Status = AcpiDsCreateExternalRegion (Status, Arg,
526 Arg->Common.Value.Name, WalkState, &RegionNode);
528 if (ACPI_FAILURE (Status))
530 ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status);
531 return_ACPI_STATUS (Status);
535 ACPI_MEMSET (&Info, 0, sizeof (ACPI_CREATE_FIELD_INFO));
537 /* Second arg is the field flags */
539 Arg = Arg->Common.Next;
540 Info.FieldFlags = (UINT8) Arg->Common.Value.Integer;
543 /* Each remaining arg is a Named Field */
545 Info.FieldType = ACPI_TYPE_LOCAL_REGION_FIELD;
546 Info.RegionNode = RegionNode;
548 Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next);
549 return_ACPI_STATUS (Status);
553 /*******************************************************************************
555 * FUNCTION: AcpiDsInitFieldObjects
557 * PARAMETERS: Op - Op containing the Field definition and args
558 * ` WalkState - Current method state
562 * DESCRIPTION: For each "Field Unit" name in the argument list that is
563 * part of the field declaration, enter the name into the
566 ******************************************************************************/
569 AcpiDsInitFieldObjects (
570 ACPI_PARSE_OBJECT *Op,
571 ACPI_WALK_STATE *WalkState)
574 ACPI_PARSE_OBJECT *Arg = NULL;
575 ACPI_NAMESPACE_NODE *Node;
580 ACPI_FUNCTION_TRACE_PTR (DsInitFieldObjects, Op);
583 /* Execute flag should always be set when this function is entered */
585 if (!(WalkState->ParseFlags & ACPI_PARSE_EXECUTE))
587 if (WalkState->ParseFlags & ACPI_PARSE_DEFERRED_OP)
589 /* BankField Op is deferred, just return OK */
591 return_ACPI_STATUS (AE_OK);
594 return_ACPI_STATUS (AE_AML_INTERNAL);
598 * Get the FieldList argument for this opcode. This is the start of the
599 * list of field elements.
601 switch (WalkState->Opcode)
605 Arg = AcpiPsGetArg (Op, 2);
606 Type = ACPI_TYPE_LOCAL_REGION_FIELD;
609 case AML_BANK_FIELD_OP:
611 Arg = AcpiPsGetArg (Op, 4);
612 Type = ACPI_TYPE_LOCAL_BANK_FIELD;
615 case AML_INDEX_FIELD_OP:
617 Arg = AcpiPsGetArg (Op, 3);
618 Type = ACPI_TYPE_LOCAL_INDEX_FIELD;
623 return_ACPI_STATUS (AE_BAD_PARAMETER);
626 /* Creating new namespace node(s), should not already exist */
628 Flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
629 ACPI_NS_ERROR_IF_FOUND;
632 * Mark node(s) temporary if we are executing a normal control
633 * method. (Don't mark if this is a module-level code method)
635 if (WalkState->MethodNode &&
636 !(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
638 Flags |= ACPI_NS_TEMPORARY;
642 * Walk the list of entries in the FieldList
643 * Note: FieldList can be of zero length. In this case, Arg will be NULL.
648 * Ignore OFFSET/ACCESSAS/CONNECTION terms here; we are only interested
649 * in the field names in order to enter them into the namespace.
651 if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
653 Status = AcpiNsLookup (WalkState->ScopeInfo,
654 (char *) &Arg->Named.Name, Type, ACPI_IMODE_LOAD_PASS1,
655 Flags, WalkState, &Node);
656 if (ACPI_FAILURE (Status))
658 ACPI_ERROR_NAMESPACE ((char *) &Arg->Named.Name, Status);
659 if (Status != AE_ALREADY_EXISTS)
661 return_ACPI_STATUS (Status);
664 /* Name already exists, just ignore this error */
669 Arg->Common.Node = Node;
672 /* Get the next field element in the list */
674 Arg = Arg->Common.Next;
677 return_ACPI_STATUS (AE_OK);
681 /*******************************************************************************
683 * FUNCTION: AcpiDsCreateBankField
685 * PARAMETERS: Op - Op containing the Field definition and args
686 * RegionNode - Object for the containing Operation Region
687 * WalkState - Current method state
691 * DESCRIPTION: Create a new bank field in the specified operation region
693 ******************************************************************************/
696 AcpiDsCreateBankField (
697 ACPI_PARSE_OBJECT *Op,
698 ACPI_NAMESPACE_NODE *RegionNode,
699 ACPI_WALK_STATE *WalkState)
702 ACPI_PARSE_OBJECT *Arg;
703 ACPI_CREATE_FIELD_INFO Info;
706 ACPI_FUNCTION_TRACE_PTR (DsCreateBankField, Op);
709 /* First arg is the name of the parent OpRegion (must already exist) */
711 Arg = Op->Common.Value.Arg;
714 Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name,
715 ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
716 ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
717 #ifdef ACPI_ASL_COMPILER
718 Status = AcpiDsCreateExternalRegion (Status, Arg,
719 Arg->Common.Value.Name, WalkState, &RegionNode);
721 if (ACPI_FAILURE (Status))
723 ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status);
724 return_ACPI_STATUS (Status);
728 /* Second arg is the Bank Register (Field) (must already exist) */
730 Arg = Arg->Common.Next;
731 Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
732 ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
733 ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode);
734 if (ACPI_FAILURE (Status))
736 ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
737 return_ACPI_STATUS (Status);
741 * Third arg is the BankValue
742 * This arg is a TermArg, not a constant
743 * It will be evaluated later, by AcpiDsEvalBankFieldOperands
745 Arg = Arg->Common.Next;
747 /* Fourth arg is the field flags */
749 Arg = Arg->Common.Next;
750 Info.FieldFlags = (UINT8) Arg->Common.Value.Integer;
752 /* Each remaining arg is a Named Field */
754 Info.FieldType = ACPI_TYPE_LOCAL_BANK_FIELD;
755 Info.RegionNode = RegionNode;
758 * Use Info.DataRegisterNode to store BankField Op
759 * It's safe because DataRegisterNode will never be used when create bank field
760 * We store AmlStart and AmlLength in the BankField Op for late evaluation
761 * Used in AcpiExPrepFieldValue(Info)
763 * TBD: Or, should we add a field in ACPI_CREATE_FIELD_INFO, like "void *ParentOp"?
765 Info.DataRegisterNode = (ACPI_NAMESPACE_NODE*) Op;
767 Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next);
768 return_ACPI_STATUS (Status);
772 /*******************************************************************************
774 * FUNCTION: AcpiDsCreateIndexField
776 * PARAMETERS: Op - Op containing the Field definition and args
777 * RegionNode - Object for the containing Operation Region
778 * ` WalkState - Current method state
782 * DESCRIPTION: Create a new index field in the specified operation region
784 ******************************************************************************/
787 AcpiDsCreateIndexField (
788 ACPI_PARSE_OBJECT *Op,
789 ACPI_NAMESPACE_NODE *RegionNode,
790 ACPI_WALK_STATE *WalkState)
793 ACPI_PARSE_OBJECT *Arg;
794 ACPI_CREATE_FIELD_INFO Info;
797 ACPI_FUNCTION_TRACE_PTR (DsCreateIndexField, Op);
800 /* First arg is the name of the Index register (must already exist) */
802 Arg = Op->Common.Value.Arg;
803 Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
804 ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
805 ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode);
806 if (ACPI_FAILURE (Status))
808 ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
809 return_ACPI_STATUS (Status);
812 /* Second arg is the data register (must already exist) */
814 Arg = Arg->Common.Next;
815 Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
816 ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
817 ACPI_NS_SEARCH_PARENT, WalkState, &Info.DataRegisterNode);
818 if (ACPI_FAILURE (Status))
820 ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
821 return_ACPI_STATUS (Status);
824 /* Next arg is the field flags */
826 Arg = Arg->Common.Next;
827 Info.FieldFlags = (UINT8) Arg->Common.Value.Integer;
829 /* Each remaining arg is a Named Field */
831 Info.FieldType = ACPI_TYPE_LOCAL_INDEX_FIELD;
832 Info.RegionNode = RegionNode;
834 Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next);
835 return_ACPI_STATUS (Status);