dsfield.c revision 104470
1/****************************************************************************** 2 * 3 * Module Name: dsfield - Dispatcher field routines 4 * $Revision: 68 $ 5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp. 13 * All rights reserved. 14 * 15 * 2. License 16 * 17 * 2.1. This is your license from Intel Corp. under its intellectual property 18 * rights. You may have additional license terms from the party that provided 19 * you this software, covering your right to use that party's intellectual 20 * property rights. 21 * 22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 23 * copy of the source code appearing in this file ("Covered Code") an 24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the 25 * base code distributed originally by Intel ("Original Intel Code") to copy, 26 * make derivatives, distribute, use and display any portion of the Covered 27 * Code in any form, with the right to sublicense such rights; and 28 * 29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30 * license (with the right to sublicense), under only those claims of Intel 31 * patents that are infringed by the Original Intel Code, to make, use, sell, 32 * offer to sell, and import the Covered Code and derivative works thereof 33 * solely to the minimum extent necessary to exercise the above copyright 34 * license, and in no event shall the patent license extend to any additions 35 * to or modifications of the Original Intel Code. No other license or right 36 * is granted directly or by implication, estoppel or otherwise; 37 * 38 * The above copyright and patent license is granted only if the following 39 * conditions are met: 40 * 41 * 3. Conditions 42 * 43 * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44 * Redistribution of source code of any substantial portion of the Covered 45 * Code or modification with rights to further distribute source must include 46 * the above Copyright Notice, the above License, this list of Conditions, 47 * and the following Disclaimer and Export Compliance provision. In addition, 48 * Licensee must cause all Covered Code to which Licensee contributes to 49 * contain a file documenting the changes Licensee made to create that Covered 50 * Code and the date of any change. Licensee must include in that file the 51 * documentation of any changes made by any predecessor Licensee. Licensee 52 * must include a prominent statement that the modification is derived, 53 * directly or indirectly, from Original Intel Code. 54 * 55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56 * Redistribution of source code of any substantial portion of the Covered 57 * Code or modification without rights to further distribute source must 58 * include the following Disclaimer and Export Compliance provision in the 59 * documentation and/or other materials provided with distribution. In 60 * addition, Licensee may not authorize further sublicense of source of any 61 * portion of the Covered Code, and must include terms to the effect that the 62 * license from Licensee to its licensee is limited to the intellectual 63 * property embodied in the software Licensee provides to its licensee, and 64 * not to intellectual property embodied in modifications its licensee may 65 * make. 66 * 67 * 3.3. Redistribution of Executable. Redistribution in executable form of any 68 * substantial portion of the Covered Code or modification must reproduce the 69 * above Copyright Notice, and the following Disclaimer and Export Compliance 70 * provision in the documentation and/or other materials provided with the 71 * distribution. 72 * 73 * 3.4. Intel retains all right, title, and interest in and to the Original 74 * Intel Code. 75 * 76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77 * Intel shall be used in advertising or otherwise to promote the sale, use or 78 * other dealings in products derived from or relating to the Covered Code 79 * without prior written authorization from Intel. 80 * 81 * 4. Disclaimer and Export Compliance 82 * 83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89 * PARTICULAR PURPOSE. 90 * 91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 98 * LIMITED REMEDY. 99 * 100 * 4.3. Licensee shall not export, either directly or indirectly, any of this 101 * software or system incorporating such software without first obtaining any 102 * required license or other approval from the U. S. Department of Commerce or 103 * any other agency or department of the United States Government. In the 104 * event Licensee exports any such software from the United States or 105 * re-exports any such software from a foreign destination, Licensee shall 106 * ensure that the distribution and export/re-export of the software is in 107 * compliance with all laws, regulations, orders, or other restrictions of the 108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109 * any of its subsidiaries will export/re-export any technical data, process, 110 * software, or service, directly or indirectly, to any country for which the 111 * United States government or any agency thereof requires an export license, 112 * other governmental approval, or letter of assurance, without first obtaining 113 * such license, approval or letter. 114 * 115 *****************************************************************************/ 116 117#define __DSFIELD_C__ 118 119#include "acpi.h" 120#include "amlcode.h" 121#include "acdispat.h" 122#include "acinterp.h" 123#include "acnamesp.h" 124#include "acparser.h" 125 126 127#define _COMPONENT ACPI_DISPATCHER 128 ACPI_MODULE_NAME ("dsfield") 129 130 131/******************************************************************************* 132 * 133 * FUNCTION: AcpiDsCreateBufferField 134 * 135 * PARAMETERS: Opcode - The opcode to be executed 136 * Operands - List of operands for the opcode 137 * WalkState - Current state 138 * 139 * RETURN: Status 140 * 141 * DESCRIPTION: Execute the CreateField operators: 142 * CreateBitFieldOp, 143 * CreateByteFieldOp, 144 * CreateWordFieldOp, 145 * CreateDWordFieldOp, 146 * CreateQWordFieldOp, 147 * CreateFieldOp (all of which define fields in buffers) 148 * 149 ******************************************************************************/ 150 151ACPI_STATUS 152AcpiDsCreateBufferField ( 153 ACPI_PARSE_OBJECT *Op, 154 ACPI_WALK_STATE *WalkState) 155{ 156 ACPI_PARSE_OBJECT *Arg; 157 ACPI_NAMESPACE_NODE *Node; 158 ACPI_STATUS Status; 159 ACPI_OPERAND_OBJECT *ObjDesc; 160 ACPI_OPERAND_OBJECT *SecondDesc = NULL; 161 UINT32 Flags; 162 163 164 ACPI_FUNCTION_TRACE ("DsCreateBufferField"); 165 166 167 /* Get the NameString argument */ 168 169 if (Op->Common.AmlOpcode == AML_CREATE_FIELD_OP) 170 { 171 Arg = AcpiPsGetArg (Op, 3); 172 } 173 else 174 { 175 /* Create Bit/Byte/Word/Dword field */ 176 177 Arg = AcpiPsGetArg (Op, 2); 178 } 179 180 if (!Arg) 181 { 182 return_ACPI_STATUS (AE_AML_NO_OPERAND); 183 } 184 185 /* 186 * During the load phase, we want to enter the name of the field into 187 * the namespace. During the execute phase (when we evaluate the size 188 * operand), we want to lookup the name 189 */ 190 if (WalkState->ParseFlags & ACPI_PARSE_EXECUTE) 191 { 192 Flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE; 193 } 194 else 195 { 196 Flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND; 197 } 198 199 /* 200 * Enter the NameString into the namespace 201 */ 202 Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String, 203 INTERNAL_TYPE_DEF_ANY, ACPI_IMODE_LOAD_PASS1, 204 Flags, WalkState, &(Node)); 205 if (ACPI_FAILURE (Status)) 206 { 207 ACPI_REPORT_NSERROR (Arg->Common.Value.String, Status); 208 return_ACPI_STATUS (Status); 209 } 210 211 /* We could put the returned object (Node) on the object stack for later, but 212 * for now, we will put it in the "op" object that the parser uses, so we 213 * can get it again at the end of this scope 214 */ 215 Op->Common.Node = Node; 216 217 /* 218 * If there is no object attached to the node, this node was just created and 219 * we need to create the field object. Otherwise, this was a lookup of an 220 * existing node and we don't want to create the field object again. 221 */ 222 ObjDesc = AcpiNsGetAttachedObject (Node); 223 if (ObjDesc) 224 { 225 return_ACPI_STATUS (AE_OK); 226 } 227 228 /* 229 * The Field definition is not fully parsed at this time. 230 * (We must save the address of the AML for the buffer and index operands) 231 */ 232 233 /* Create the buffer field object */ 234 235 ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER_FIELD); 236 if (!ObjDesc) 237 { 238 Status = AE_NO_MEMORY; 239 goto Cleanup; 240 } 241 242 /* 243 * Remember location in AML stream of the field unit 244 * opcode and operands -- since the buffer and index 245 * operands must be evaluated. 246 */ 247 SecondDesc = ObjDesc->Common.NextObject; 248 SecondDesc->Extra.AmlStart = Op->Named.Data; 249 SecondDesc->Extra.AmlLength = Op->Named.Length; 250 ObjDesc->BufferField.Node = Node; 251 252 /* Attach constructed field descriptors to parent node */ 253 254 Status = AcpiNsAttachObject (Node, ObjDesc, ACPI_TYPE_BUFFER_FIELD); 255 if (ACPI_FAILURE (Status)) 256 { 257 goto Cleanup; 258 } 259 260 261Cleanup: 262 263 /* Remove local reference to the object */ 264 265 AcpiUtRemoveReference (ObjDesc); 266 return_ACPI_STATUS (Status); 267} 268 269 270/******************************************************************************* 271 * 272 * FUNCTION: AcpiDsGetFieldNames 273 * 274 * PARAMETERS: Info - CreateField info structure 275 * ` WalkState - Current method state 276 * Arg - First parser arg for the field name list 277 * 278 * RETURN: Status 279 * 280 * DESCRIPTION: Process all named fields in a field declaration. Names are 281 * entered into the namespace. 282 * 283 ******************************************************************************/ 284 285ACPI_STATUS 286AcpiDsGetFieldNames ( 287 ACPI_CREATE_FIELD_INFO *Info, 288 ACPI_WALK_STATE *WalkState, 289 ACPI_PARSE_OBJECT *Arg) 290{ 291 ACPI_STATUS Status; 292 ACPI_INTEGER Position; 293 294 295 ACPI_FUNCTION_TRACE_PTR ("DsGetFieldNames", Info); 296 297 298 /* First field starts at bit zero */ 299 300 Info->FieldBitPosition = 0; 301 302 /* Process all elements in the field list (of parse nodes) */ 303 304 while (Arg) 305 { 306 /* 307 * Three types of field elements are handled: 308 * 1) Offset - specifies a bit offset 309 * 2) AccessAs - changes the access mode 310 * 3) Name - Enters a new named field into the namespace 311 */ 312 switch (Arg->Common.AmlOpcode) 313 { 314 case AML_INT_RESERVEDFIELD_OP: 315 316 Position = (ACPI_INTEGER) Info->FieldBitPosition 317 + (ACPI_INTEGER) Arg->Common.Value.Size; 318 319 if (Position > ACPI_UINT32_MAX) 320 { 321 ACPI_REPORT_ERROR (("Bit offset within field too large (> 0xFFFFFFFF)\n")); 322 return_ACPI_STATUS (AE_SUPPORT); 323 } 324 325 Info->FieldBitPosition = (UINT32) Position; 326 break; 327 328 329 case AML_INT_ACCESSFIELD_OP: 330 331 /* 332 * Get a new AccessType and AccessAttribute -- to be used for all 333 * field units that follow, until field end or another AccessAs keyword. 334 * 335 * In FieldFlags, preserve the flag bits other than the ACCESS_TYPE bits 336 */ 337 Info->FieldFlags = (UINT8) ((Info->FieldFlags & ~(AML_FIELD_ACCESS_TYPE_MASK)) | 338 ((UINT8) (Arg->Common.Value.Integer32 >> 8))); 339 340 Info->Attribute = (UINT8) (Arg->Common.Value.Integer32); 341 break; 342 343 344 case AML_INT_NAMEDFIELD_OP: 345 346 /* Lookup the name */ 347 348 Status = AcpiNsLookup (WalkState->ScopeInfo, 349 (NATIVE_CHAR *) &Arg->Named.Name, 350 Info->FieldType, ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE, 351 WalkState, &Info->FieldNode); 352 if (ACPI_FAILURE (Status)) 353 { 354 ACPI_REPORT_NSERROR ((char *) &Arg->Named.Name, Status); 355 if (Status != AE_ALREADY_EXISTS) 356 { 357 return_ACPI_STATUS (Status); 358 } 359 360 /* Already exists, ignore error */ 361 } 362 else 363 { 364 Arg->Common.Node = Info->FieldNode; 365 Info->FieldBitLength = Arg->Common.Value.Size; 366 367 /* Create and initialize an object for the new Field Node */ 368 369 Status = AcpiExPrepFieldValue (Info); 370 if (ACPI_FAILURE (Status)) 371 { 372 return_ACPI_STATUS (Status); 373 } 374 } 375 376 /* Keep track of bit position for the next field */ 377 378 Position = (ACPI_INTEGER) Info->FieldBitPosition 379 + (ACPI_INTEGER) Arg->Common.Value.Size; 380 381 if (Position > ACPI_UINT32_MAX) 382 { 383 ACPI_REPORT_ERROR (("Field [%4.4s] bit offset too large (> 0xFFFFFFFF)\n", 384 (char *) &Info->FieldNode->Name)); 385 return_ACPI_STATUS (AE_SUPPORT); 386 } 387 388 Info->FieldBitPosition += Info->FieldBitLength; 389 break; 390 391 392 default: 393 394 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid opcode in field list: %X\n", 395 Arg->Common.AmlOpcode)); 396 return_ACPI_STATUS (AE_AML_BAD_OPCODE); 397 } 398 399 Arg = Arg->Common.Next; 400 } 401 402 return_ACPI_STATUS (AE_OK); 403} 404 405 406/******************************************************************************* 407 * 408 * FUNCTION: AcpiDsCreateField 409 * 410 * PARAMETERS: Op - Op containing the Field definition and args 411 * RegionNode - Object for the containing Operation Region 412 * ` WalkState - Current method state 413 * 414 * RETURN: Status 415 * 416 * DESCRIPTION: Create a new field in the specified operation region 417 * 418 ******************************************************************************/ 419 420ACPI_STATUS 421AcpiDsCreateField ( 422 ACPI_PARSE_OBJECT *Op, 423 ACPI_NAMESPACE_NODE *RegionNode, 424 ACPI_WALK_STATE *WalkState) 425{ 426 ACPI_STATUS Status; 427 ACPI_PARSE_OBJECT *Arg; 428 ACPI_CREATE_FIELD_INFO Info; 429 430 431 ACPI_FUNCTION_TRACE_PTR ("DsCreateField", Op); 432 433 434 /* First arg is the name of the parent OpRegion (must already exist) */ 435 436 Arg = Op->Common.Value.Arg; 437 if (!RegionNode) 438 { 439 Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name, 440 ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, 441 ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode); 442 if (ACPI_FAILURE (Status)) 443 { 444 ACPI_REPORT_NSERROR (Arg->Common.Value.Name, Status); 445 return_ACPI_STATUS (Status); 446 } 447 } 448 449 /* Second arg is the field flags */ 450 451 Arg = Arg->Common.Next; 452 Info.FieldFlags = Arg->Common.Value.Integer8; 453 Info.Attribute = 0; 454 455 /* Each remaining arg is a Named Field */ 456 457 Info.FieldType = INTERNAL_TYPE_REGION_FIELD; 458 Info.RegionNode = RegionNode; 459 460 Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next); 461 462 return_ACPI_STATUS (Status); 463} 464 465 466/******************************************************************************* 467 * 468 * FUNCTION: AcpiDsInitFieldObjects 469 * 470 * PARAMETERS: Op - Op containing the Field definition and args 471 * ` WalkState - Current method state 472 * 473 * RETURN: Status 474 * 475 * DESCRIPTION: For each "Field Unit" name in the argument list that is 476 * part of the field declaration, enter the name into the 477 * namespace. 478 * 479 ******************************************************************************/ 480 481ACPI_STATUS 482AcpiDsInitFieldObjects ( 483 ACPI_PARSE_OBJECT *Op, 484 ACPI_WALK_STATE *WalkState) 485{ 486 ACPI_STATUS Status; 487 ACPI_PARSE_OBJECT *Arg = NULL; 488 ACPI_NAMESPACE_NODE *Node; 489 UINT8 Type = 0; 490 491 492 ACPI_FUNCTION_TRACE_PTR ("DsInitFieldObjects", Op); 493 494 495 switch (WalkState->Opcode) 496 { 497 case AML_FIELD_OP: 498 Arg = AcpiPsGetArg (Op, 2); 499 Type = INTERNAL_TYPE_REGION_FIELD; 500 break; 501 502 case AML_BANK_FIELD_OP: 503 Arg = AcpiPsGetArg (Op, 4); 504 Type = INTERNAL_TYPE_BANK_FIELD; 505 break; 506 507 case AML_INDEX_FIELD_OP: 508 Arg = AcpiPsGetArg (Op, 3); 509 Type = INTERNAL_TYPE_INDEX_FIELD; 510 break; 511 512 default: 513 return_ACPI_STATUS (AE_BAD_PARAMETER); 514 } 515 516 /* 517 * Walk the list of entries in the FieldList 518 */ 519 while (Arg) 520 { 521 /* Ignore OFFSET and ACCESSAS terms here */ 522 523 if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP) 524 { 525 Status = AcpiNsLookup (WalkState->ScopeInfo, 526 (NATIVE_CHAR *) &Arg->Named.Name, 527 Type, ACPI_IMODE_LOAD_PASS1, 528 ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND, 529 WalkState, &Node); 530 if (ACPI_FAILURE (Status)) 531 { 532 ACPI_REPORT_NSERROR ((char *) &Arg->Named.Name, Status); 533 if (Status != AE_ALREADY_EXISTS) 534 { 535 return_ACPI_STATUS (Status); 536 } 537 538 /* Name already exists, just ignore this error */ 539 540 Status = AE_OK; 541 } 542 543 Arg->Common.Node = Node; 544 } 545 546 /* Move to next field in the list */ 547 548 Arg = Arg->Common.Next; 549 } 550 551 return_ACPI_STATUS (AE_OK); 552} 553 554 555/******************************************************************************* 556 * 557 * FUNCTION: AcpiDsCreateBankField 558 * 559 * PARAMETERS: Op - Op containing the Field definition and args 560 * RegionNode - Object for the containing Operation Region 561 * ` WalkState - Current method state 562 * 563 * RETURN: Status 564 * 565 * DESCRIPTION: Create a new bank field in the specified operation region 566 * 567 ******************************************************************************/ 568 569ACPI_STATUS 570AcpiDsCreateBankField ( 571 ACPI_PARSE_OBJECT *Op, 572 ACPI_NAMESPACE_NODE *RegionNode, 573 ACPI_WALK_STATE *WalkState) 574{ 575 ACPI_STATUS Status; 576 ACPI_PARSE_OBJECT *Arg; 577 ACPI_CREATE_FIELD_INFO Info; 578 579 580 ACPI_FUNCTION_TRACE_PTR ("DsCreateBankField", Op); 581 582 583 /* First arg is the name of the parent OpRegion (must already exist) */ 584 585 Arg = Op->Common.Value.Arg; 586 if (!RegionNode) 587 { 588 Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name, 589 ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, 590 ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode); 591 if (ACPI_FAILURE (Status)) 592 { 593 ACPI_REPORT_NSERROR (Arg->Common.Value.Name, Status); 594 return_ACPI_STATUS (Status); 595 } 596 } 597 598 /* Second arg is the Bank Register (must already exist) */ 599 600 Arg = Arg->Common.Next; 601 Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String, 602 INTERNAL_TYPE_BANK_FIELD_DEFN, ACPI_IMODE_EXECUTE, 603 ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode); 604 if (ACPI_FAILURE (Status)) 605 { 606 ACPI_REPORT_NSERROR (Arg->Common.Value.String, Status); 607 return_ACPI_STATUS (Status); 608 } 609 610 /* Third arg is the BankValue */ 611 612 Arg = Arg->Common.Next; 613 Info.BankValue = Arg->Common.Value.Integer32; 614 615 /* Fourth arg is the field flags */ 616 617 Arg = Arg->Common.Next; 618 Info.FieldFlags = Arg->Common.Value.Integer8; 619 620 /* Each remaining arg is a Named Field */ 621 622 Info.FieldType = INTERNAL_TYPE_BANK_FIELD; 623 Info.RegionNode = RegionNode; 624 625 Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next); 626 627 return_ACPI_STATUS (Status); 628} 629 630 631/******************************************************************************* 632 * 633 * FUNCTION: AcpiDsCreateIndexField 634 * 635 * PARAMETERS: Op - Op containing the Field definition and args 636 * RegionNode - Object for the containing Operation Region 637 * ` WalkState - Current method state 638 * 639 * RETURN: Status 640 * 641 * DESCRIPTION: Create a new index field in the specified operation region 642 * 643 ******************************************************************************/ 644 645ACPI_STATUS 646AcpiDsCreateIndexField ( 647 ACPI_PARSE_OBJECT *Op, 648 ACPI_NAMESPACE_NODE *RegionNode, 649 ACPI_WALK_STATE *WalkState) 650{ 651 ACPI_STATUS Status; 652 ACPI_PARSE_OBJECT *Arg; 653 ACPI_CREATE_FIELD_INFO Info; 654 655 656 ACPI_FUNCTION_TRACE_PTR ("DsCreateIndexField", Op); 657 658 659 /* First arg is the name of the Index register (must already exist) */ 660 661 Arg = Op->Common.Value.Arg; 662 Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String, 663 ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, 664 ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode); 665 if (ACPI_FAILURE (Status)) 666 { 667 ACPI_REPORT_NSERROR (Arg->Common.Value.String, Status); 668 return_ACPI_STATUS (Status); 669 } 670 671 /* Second arg is the data register (must already exist) */ 672 673 Arg = Arg->Common.Next; 674 Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String, 675 INTERNAL_TYPE_INDEX_FIELD_DEFN, ACPI_IMODE_EXECUTE, 676 ACPI_NS_SEARCH_PARENT, WalkState, &Info.DataRegisterNode); 677 if (ACPI_FAILURE (Status)) 678 { 679 ACPI_REPORT_NSERROR (Arg->Common.Value.String, Status); 680 return_ACPI_STATUS (Status); 681 } 682 683 /* Next arg is the field flags */ 684 685 Arg = Arg->Common.Next; 686 Info.FieldFlags = Arg->Common.Value.Integer8; 687 688 /* Each remaining arg is a Named Field */ 689 690 Info.FieldType = INTERNAL_TYPE_INDEX_FIELD; 691 Info.RegionNode = RegionNode; 692 693 Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next); 694 695 return_ACPI_STATUS (Status); 696} 697 698 699