Deleted Added
full compact
dswload.c (99146) dswload.c (99679)
1/******************************************************************************
2 *
3 * Module Name: dswload - Dispatcher namespace load callbacks
1/******************************************************************************
2 *
3 * Module Name: dswload - Dispatcher namespace load callbacks
4 * $Revision: 62 $
4 * $Revision: 66 $
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.

--- 190 unchanged lines hidden (view full) ---

203
204
205 ACPI_FUNCTION_NAME ("DsLoad1BeginOp");
206
207 Op = WalkState->Op;
208 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
209
210
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.

--- 190 unchanged lines hidden (view full) ---

203
204
205 ACPI_FUNCTION_NAME ("DsLoad1BeginOp");
206
207 Op = WalkState->Op;
208 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
209
210
211 if (Op && (Op->Opcode == AML_INT_NAMEDFIELD_OP))
211 if (Op && (Op->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP))
212 {
213 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
214 }
215
216 /* We are only interested in opcodes that have an associated name */
217
212 {
213 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
214 }
215
216 /* We are only interested in opcodes that have an associated name */
217
218 if (WalkState->Op)
218 if (Op)
219 {
219 {
220 if (!(WalkState->OpInfo->Flags & AML_NAMED))
220 if (!(WalkState->OpInfo->Flags & AML_NAMED))
221 {
222 *OutOp = Op;
223 return (AE_OK);
224 }
225
226 /* Check if this object has already been installed in the namespace */
227
221 {
222 *OutOp = Op;
223 return (AE_OK);
224 }
225
226 /* Check if this object has already been installed in the namespace */
227
228 if (Op->Node)
228 if (Op->Common.Node)
229 {
230 *OutOp = Op;
231 return (AE_OK);
232 }
233 }
234
235 Path = AcpiPsGetNextNamestring (&WalkState->ParserState);
236
237 /* Map the raw opcode into an internal object type */
238
239 ObjectType = WalkState->OpInfo->ObjectType;
240
241 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
229 {
230 *OutOp = Op;
231 return (AE_OK);
232 }
233 }
234
235 Path = AcpiPsGetNextNamestring (&WalkState->ParserState);
236
237 /* Map the raw opcode into an internal object type */
238
239 ObjectType = WalkState->OpInfo->ObjectType;
240
241 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
242 "State=%p Op=%p Type=%x\n", WalkState, Op, ObjectType));
242 "State=%p Op=%p Type=%X\n", WalkState, Op, ObjectType));
243
244 /*
245 * Enter the named type into the internal namespace. We enter the name
246 * as we go downward in the parse tree. Any necessary subobjects that involve
247 * arguments to the opcode must be created as we go back up the parse tree later.
248 */
249 Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
250 ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH, WalkState, &(Node));

--- 11 unchanged lines hidden (view full) ---

262 if (!Op)
263 {
264 return (AE_NO_MEMORY);
265 }
266 }
267
268 /* Initialize */
269
243
244 /*
245 * Enter the named type into the internal namespace. We enter the name
246 * as we go downward in the parse tree. Any necessary subobjects that involve
247 * arguments to the opcode must be created as we go back up the parse tree later.
248 */
249 Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
250 ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH, WalkState, &(Node));

--- 11 unchanged lines hidden (view full) ---

262 if (!Op)
263 {
264 return (AE_NO_MEMORY);
265 }
266 }
267
268 /* Initialize */
269
270 ((ACPI_PARSE2_OBJECT *)Op)->Name = Node->Name.Integer;
270 Op->Named.Name = Node->Name.Integer;
271
272 /*
273 * Put the Node in the "op" object that the parser uses, so we
274 * can get it again quickly when this scope is closed
275 */
271
272 /*
273 * Put the Node in the "op" object that the parser uses, so we
274 * can get it again quickly when this scope is closed
275 */
276 Op->Node = Node;
276 Op->Common.Node = Node;
277 AcpiPsAppendArg (AcpiPsGetParentScope (&WalkState->ParserState), Op);
278
279 *OutOp = Op;
280 return (Status);
281}
282
283
284/*******************************************************************************

--- 12 unchanged lines hidden (view full) ---

297 ******************************************************************************/
298
299ACPI_STATUS
300AcpiDsLoad1EndOp (
301 ACPI_WALK_STATE *WalkState)
302{
303 ACPI_PARSE_OBJECT *Op;
304 ACPI_OBJECT_TYPE ObjectType;
277 AcpiPsAppendArg (AcpiPsGetParentScope (&WalkState->ParserState), Op);
278
279 *OutOp = Op;
280 return (Status);
281}
282
283
284/*******************************************************************************

--- 12 unchanged lines hidden (view full) ---

297 ******************************************************************************/
298
299ACPI_STATUS
300AcpiDsLoad1EndOp (
301 ACPI_WALK_STATE *WalkState)
302{
303 ACPI_PARSE_OBJECT *Op;
304 ACPI_OBJECT_TYPE ObjectType;
305 ACPI_STATUS Status = AE_OK;
305
306
307 ACPI_FUNCTION_NAME ("DsLoad1EndOp");
308
309 Op = WalkState->Op;
310 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
311
312

--- 9 unchanged lines hidden (view full) ---

322 ObjectType = WalkState->OpInfo->ObjectType;
323
324 if (WalkState->OpInfo->Flags & AML_FIELD)
325 {
326 if (WalkState->Opcode == AML_FIELD_OP ||
327 WalkState->Opcode == AML_BANK_FIELD_OP ||
328 WalkState->Opcode == AML_INDEX_FIELD_OP)
329 {
306
307
308 ACPI_FUNCTION_NAME ("DsLoad1EndOp");
309
310 Op = WalkState->Op;
311 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
312
313

--- 9 unchanged lines hidden (view full) ---

323 ObjectType = WalkState->OpInfo->ObjectType;
324
325 if (WalkState->OpInfo->Flags & AML_FIELD)
326 {
327 if (WalkState->Opcode == AML_FIELD_OP ||
328 WalkState->Opcode == AML_BANK_FIELD_OP ||
329 WalkState->Opcode == AML_INDEX_FIELD_OP)
330 {
330 AcpiDsInitFieldObjects (Op, WalkState);
331 Status = AcpiDsInitFieldObjects (Op, WalkState);
331 }
332 }
332 return (AE_OK);
333 return (Status);
333 }
334
335
334 }
335
336
336 if (Op->Opcode == AML_REGION_OP)
337 if (Op->Common.AmlOpcode == AML_REGION_OP)
337 {
338 {
338 /*Status = */AcpiExCreateRegion (((ACPI_PARSE2_OBJECT *) Op)->Data,
339 ((ACPI_PARSE2_OBJECT *) Op)->Length,
340 (ACPI_ADR_SPACE_TYPE) ((Op->Value.Arg)->Value.Integer), WalkState);
339 Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
340 (ACPI_ADR_SPACE_TYPE) ((Op->Common.Value.Arg)->Common.Value.Integer), WalkState);
341 if (ACPI_FAILURE (Status))
342 {
343 return (Status);
344 }
341 }
342
345 }
346
343 if (Op->Opcode == AML_NAME_OP)
347 if (Op->Common.AmlOpcode == AML_NAME_OP)
344 {
345 /* For Name opcode, get the object type from the argument */
346
348 {
349 /* For Name opcode, get the object type from the argument */
350
347 if (Op->Value.Arg)
351 if (Op->Common.Value.Arg)
348 {
352 {
349 ObjectType = (AcpiPsGetOpcodeInfo ((Op->Value.Arg)->Opcode))->ObjectType;
350 Op->Node->Type = (UINT8) ObjectType;
353 ObjectType = (AcpiPsGetOpcodeInfo ((Op->Common.Value.Arg)->Common.AmlOpcode))->ObjectType;
354 Op->Common.Node->Type = (UINT8) ObjectType;
351 }
352 }
353
354 /* Pop the scope stack */
355
356 if (AcpiNsOpensScope (ObjectType))
357 {
358 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s): Popping scope for Op %p\n",
359 AcpiUtGetTypeName (ObjectType), Op));
360
355 }
356 }
357
358 /* Pop the scope stack */
359
360 if (AcpiNsOpensScope (ObjectType))
361 {
362 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s): Popping scope for Op %p\n",
363 AcpiUtGetTypeName (ObjectType), Op));
364
361 AcpiDsScopeStackPop (WalkState);
365 Status = AcpiDsScopeStackPop (WalkState);
362 }
363
366 }
367
364 return (AE_OK);
368 return (Status);
365}
366
367
368/*******************************************************************************
369 *
370 * FUNCTION: AcpiDsLoad2BeginOp
371 *
372 * PARAMETERS: WalkState - Current state of the parse tree walk

--- 11 unchanged lines hidden (view full) ---

384 ACPI_WALK_STATE *WalkState,
385 ACPI_PARSE_OBJECT **OutOp)
386{
387 ACPI_PARSE_OBJECT *Op;
388 ACPI_NAMESPACE_NODE *Node;
389 ACPI_STATUS Status;
390 ACPI_OBJECT_TYPE ObjectType;
391 NATIVE_CHAR *BufferPtr;
369}
370
371
372/*******************************************************************************
373 *
374 * FUNCTION: AcpiDsLoad2BeginOp
375 *
376 * PARAMETERS: WalkState - Current state of the parse tree walk

--- 11 unchanged lines hidden (view full) ---

388 ACPI_WALK_STATE *WalkState,
389 ACPI_PARSE_OBJECT **OutOp)
390{
391 ACPI_PARSE_OBJECT *Op;
392 ACPI_NAMESPACE_NODE *Node;
393 ACPI_STATUS Status;
394 ACPI_OBJECT_TYPE ObjectType;
395 NATIVE_CHAR *BufferPtr;
392 void *Original = NULL;
393
394
395 ACPI_FUNCTION_NAME ("DsLoad2BeginOp");
396
397
398 Op = WalkState->Op;
399 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
400

--- 9 unchanged lines hidden (view full) ---

410
411 /*
412 * Get the name we are going to enter or lookup in the namespace
413 */
414 if (WalkState->Opcode == AML_INT_NAMEPATH_OP)
415 {
416 /* For Namepath op, get the path string */
417
396
397
398 ACPI_FUNCTION_NAME ("DsLoad2BeginOp");
399
400
401 Op = WalkState->Op;
402 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
403

--- 9 unchanged lines hidden (view full) ---

413
414 /*
415 * Get the name we are going to enter or lookup in the namespace
416 */
417 if (WalkState->Opcode == AML_INT_NAMEPATH_OP)
418 {
419 /* For Namepath op, get the path string */
420
418 BufferPtr = Op->Value.String;
421 BufferPtr = Op->Common.Value.String;
419 if (!BufferPtr)
420 {
421 /* No name, just exit */
422
423 return (AE_OK);
424 }
425 }
426 else
427 {
428 /* Get name from the op */
429
422 if (!BufferPtr)
423 {
424 /* No name, just exit */
425
426 return (AE_OK);
427 }
428 }
429 else
430 {
431 /* Get name from the op */
432
430 BufferPtr = (NATIVE_CHAR *) &((ACPI_PARSE2_OBJECT *)Op)->Name;
433 BufferPtr = (NATIVE_CHAR *) &Op->Named.Name;
431 }
432 }
433 else
434 {
435 /* Get the namestring from the raw AML */
436
437 BufferPtr = AcpiPsGetNextNamestring (&WalkState->ParserState);
438 }
439
440 /* Map the opcode into an internal object type */
441
442 ObjectType = WalkState->OpInfo->ObjectType;
443
444 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
434 }
435 }
436 else
437 {
438 /* Get the namestring from the raw AML */
439
440 BufferPtr = AcpiPsGetNextNamestring (&WalkState->ParserState);
441 }
442
443 /* Map the opcode into an internal object type */
444
445 ObjectType = WalkState->OpInfo->ObjectType;
446
447 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
445 "State=%p Op=%p Type=%x\n", WalkState, Op, ObjectType));
448 "State=%p Op=%p Type=%X\n", WalkState, Op, ObjectType));
446
447
448 if (WalkState->Opcode == AML_FIELD_OP ||
449 WalkState->Opcode == AML_BANK_FIELD_OP ||
450 WalkState->Opcode == AML_INDEX_FIELD_OP)
451 {
452 Node = NULL;
453 Status = AE_OK;

--- 4 unchanged lines hidden (view full) ---

458 * The NamePath is an object reference to an existing object. Don't enter the
459 * name into the namespace, but look it up for use later
460 */
461 Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
462 ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &(Node));
463 }
464 else
465 {
449
450
451 if (WalkState->Opcode == AML_FIELD_OP ||
452 WalkState->Opcode == AML_BANK_FIELD_OP ||
453 WalkState->Opcode == AML_INDEX_FIELD_OP)
454 {
455 Node = NULL;
456 Status = AE_OK;

--- 4 unchanged lines hidden (view full) ---

461 * The NamePath is an object reference to an existing object. Don't enter the
462 * name into the namespace, but look it up for use later
463 */
464 Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
465 ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &(Node));
466 }
467 else
468 {
466 if (Op && Op->Node)
469 /* All other opcodes */
470
471 if (Op && Op->Common.Node)
467 {
472 {
468 Original = Op->Node;
469 Node = Op->Node;
473 /* This op/node was previously entered into the namespace */
470
474
475 Node = Op->Common.Node;
476
471 if (AcpiNsOpensScope (ObjectType))
472 {
473 Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState);
474 if (ACPI_FAILURE (Status))
475 {
476 return (Status);
477 }
478

--- 19 unchanged lines hidden (view full) ---

498 Op = AcpiPsAllocOp (WalkState->Opcode);
499 if (!Op)
500 {
501 return (AE_NO_MEMORY);
502 }
503
504 /* Initialize the new op */
505
477 if (AcpiNsOpensScope (ObjectType))
478 {
479 Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState);
480 if (ACPI_FAILURE (Status))
481 {
482 return (Status);
483 }
484

--- 19 unchanged lines hidden (view full) ---

504 Op = AcpiPsAllocOp (WalkState->Opcode);
505 if (!Op)
506 {
507 return (AE_NO_MEMORY);
508 }
509
510 /* Initialize the new op */
511
506 ((ACPI_PARSE2_OBJECT *)Op)->Name = Node->Name.Integer;
507 *OutOp = Op;
512 if (Node)
513 {
514 Op->Named.Name = Node->Name.Integer;
515 }
516 if (OutOp)
517 {
518 *OutOp = Op;
519 }
508 }
509
510 /*
511 * Put the Node in the "op" object that the parser uses, so we
512 * can get it again quickly when this scope is closed
513 */
520 }
521
522 /*
523 * Put the Node in the "op" object that the parser uses, so we
524 * can get it again quickly when this scope is closed
525 */
514 Op->Node = Node;
515
516 if (Original)
517 {
518 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "old %p new %p\n", Original, Node));
519
520 if (Original != Node)
521 {
522 ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
523 "Lookup match error: old %p new %p\n", Original, Node));
524 }
525 }
526 Op->Common.Node = Node;
526 }
527
528 return (Status);
529}
530
531
532/*******************************************************************************
533 *

--- 31 unchanged lines hidden (view full) ---

565
566 /* Only interested in opcodes that have namespace objects */
567
568 if (!(WalkState->OpInfo->Flags & AML_NSOBJECT))
569 {
570 return (AE_OK);
571 }
572
527 }
528
529 return (Status);
530}
531
532
533/*******************************************************************************
534 *

--- 31 unchanged lines hidden (view full) ---

566
567 /* Only interested in opcodes that have namespace objects */
568
569 if (!(WalkState->OpInfo->Flags & AML_NSOBJECT))
570 {
571 return (AE_OK);
572 }
573
573 if (Op->Opcode == AML_SCOPE_OP)
574 if (Op->Common.AmlOpcode == AML_SCOPE_OP)
574 {
575 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
576 "Ending scope Op=%p State=%p\n", Op, WalkState));
577
575 {
576 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
577 "Ending scope Op=%p State=%p\n", Op, WalkState));
578
578 if (((ACPI_PARSE2_OBJECT *)Op)->Name == ACPI_UINT16_MAX)
579 if (Op->Named.Name == ACPI_UINT16_MAX)
579 {
580 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unnamed scope! Op=%p State=%p\n",
581 Op, WalkState));
582 return (AE_OK);
583 }
584 }
585
586
587 ObjectType = WalkState->OpInfo->ObjectType;
588
589 /*
590 * Get the Node/name from the earlier lookup
591 * (It was saved in the *op structure)
592 */
580 {
581 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unnamed scope! Op=%p State=%p\n",
582 Op, WalkState));
583 return (AE_OK);
584 }
585 }
586
587
588 ObjectType = WalkState->OpInfo->ObjectType;
589
590 /*
591 * Get the Node/name from the earlier lookup
592 * (It was saved in the *op structure)
593 */
593 Node = Op->Node;
594 Node = Op->Common.Node;
594
595 /*
596 * Put the Node on the object stack (Contains the ACPI Name of
597 * this object)
598 */
599 WalkState->Operands[0] = (void *) Node;
600 WalkState->NumOperands = 1;
601
602 /* Pop the scope stack */
603
604 if (AcpiNsOpensScope (ObjectType))
605 {
606 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n",
607 AcpiUtGetTypeName (ObjectType), Op));
595
596 /*
597 * Put the Node on the object stack (Contains the ACPI Name of
598 * this object)
599 */
600 WalkState->Operands[0] = (void *) Node;
601 WalkState->NumOperands = 1;
602
603 /* Pop the scope stack */
604
605 if (AcpiNsOpensScope (ObjectType))
606 {
607 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n",
608 AcpiUtGetTypeName (ObjectType), Op));
608 AcpiDsScopeStackPop (WalkState);
609
610 Status = AcpiDsScopeStackPop (WalkState);
611 if (ACPI_FAILURE (Status))
612 {
613 return (Status);
614 }
609 }
610
611 /*
612 * Named operations are as follows:
613 *
614 * AML_ALIAS
615 * AML_BANKFIELD
616 * AML_CREATEBITFIELD

--- 16 unchanged lines hidden (view full) ---

633 * AML_POWERRES
634 * AML_PROCESSOR
635 * AML_SCOPE
636 * AML_THERMALZONE
637 */
638
639 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
640 "Create-Load [%s] State=%p Op=%p NamedObj=%p\n",
615 }
616
617 /*
618 * Named operations are as follows:
619 *
620 * AML_ALIAS
621 * AML_BANKFIELD
622 * AML_CREATEBITFIELD

--- 16 unchanged lines hidden (view full) ---

639 * AML_POWERRES
640 * AML_PROCESSOR
641 * AML_SCOPE
642 * AML_THERMALZONE
643 */
644
645 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
646 "Create-Load [%s] State=%p Op=%p NamedObj=%p\n",
641 AcpiPsGetOpcodeName (Op->Opcode), WalkState, Op, Node));
647 AcpiPsGetOpcodeName (Op->Common.AmlOpcode), WalkState, Op, Node));
642
643 /* Decode the opcode */
644
648
649 /* Decode the opcode */
650
645 Arg = Op->Value.Arg;
651 Arg = Op->Common.Value.Arg;
646
647 switch (WalkState->OpInfo->Type)
648 {
649 case AML_TYPE_CREATE_FIELD:
650
651 /*
652 * Create the field object, but the field buffer and index must
653 * be evaluated later during the execution phase
654 */
655 Status = AcpiDsCreateBufferField (Op, WalkState);
656 break;
657
658
659 case AML_TYPE_NAMED_FIELD:
660
652
653 switch (WalkState->OpInfo->Type)
654 {
655 case AML_TYPE_CREATE_FIELD:
656
657 /*
658 * Create the field object, but the field buffer and index must
659 * be evaluated later during the execution phase
660 */
661 Status = AcpiDsCreateBufferField (Op, WalkState);
662 break;
663
664
665 case AML_TYPE_NAMED_FIELD:
666
661 switch (Op->Opcode)
667 switch (Op->Common.AmlOpcode)
662 {
663 case AML_INDEX_FIELD_OP:
664
668 {
669 case AML_INDEX_FIELD_OP:
670
665 Status = AcpiDsCreateIndexField (Op, (ACPI_HANDLE) Arg->Node,
671 Status = AcpiDsCreateIndexField (Op, (ACPI_HANDLE) Arg->Common.Node,
666 WalkState);
667 break;
668
669 case AML_BANK_FIELD_OP:
670
672 WalkState);
673 break;
674
675 case AML_BANK_FIELD_OP:
676
671 Status = AcpiDsCreateBankField (Op, Arg->Node, WalkState);
677 Status = AcpiDsCreateBankField (Op, Arg->Common.Node, WalkState);
672 break;
673
674 case AML_FIELD_OP:
675
678 break;
679
680 case AML_FIELD_OP:
681
676 Status = AcpiDsCreateField (Op, Arg->Node, WalkState);
682 Status = AcpiDsCreateField (Op, Arg->Common.Node, WalkState);
677 break;
683 break;
684
685 default:
686 /* All NAMED_FIELD opcodes must be handled above */
687 break;
678 }
679 break;
680
681
682 case AML_TYPE_NAMED_SIMPLE:
683
684 Status = AcpiDsCreateOperands (WalkState, Arg);
685 if (ACPI_FAILURE (Status))
686 {
687 goto Cleanup;
688 }
689
688 }
689 break;
690
691
692 case AML_TYPE_NAMED_SIMPLE:
693
694 Status = AcpiDsCreateOperands (WalkState, Arg);
695 if (ACPI_FAILURE (Status))
696 {
697 goto Cleanup;
698 }
699
690 switch (Op->Opcode)
700 switch (Op->Common.AmlOpcode)
691 {
692 case AML_PROCESSOR_OP:
693
694 Status = AcpiExCreateProcessor (WalkState);
695 break;
696
697 case AML_POWER_RES_OP:
698

--- 35 unchanged lines hidden (view full) ---

734 WalkState->Operands[i] = NULL;
735 }
736
737 break;
738
739
740 case AML_TYPE_NAMED_COMPLEX:
741
701 {
702 case AML_PROCESSOR_OP:
703
704 Status = AcpiExCreateProcessor (WalkState);
705 break;
706
707 case AML_POWER_RES_OP:
708

--- 35 unchanged lines hidden (view full) ---

744 WalkState->Operands[i] = NULL;
745 }
746
747 break;
748
749
750 case AML_TYPE_NAMED_COMPLEX:
751
742 switch (Op->Opcode)
752 switch (Op->Common.AmlOpcode)
743 {
744 case AML_METHOD_OP:
745 /*
746 * MethodOp PkgLength NameString MethodFlags TermList
747 */
748 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
749 "LOADING-Method: State=%p Op=%p NamedObj=%p\n",
750 WalkState, Op, Node));
751
752 if (!AcpiNsGetAttachedObject (Node))
753 {
754 Status = AcpiDsCreateOperands (WalkState, Arg);
755 if (ACPI_FAILURE (Status))
756 {
757 goto Cleanup;
758 }
759
753 {
754 case AML_METHOD_OP:
755 /*
756 * MethodOp PkgLength NameString MethodFlags TermList
757 */
758 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
759 "LOADING-Method: State=%p Op=%p NamedObj=%p\n",
760 WalkState, Op, Node));
761
762 if (!AcpiNsGetAttachedObject (Node))
763 {
764 Status = AcpiDsCreateOperands (WalkState, Arg);
765 if (ACPI_FAILURE (Status))
766 {
767 goto Cleanup;
768 }
769
760 Status = AcpiExCreateMethod (((ACPI_PARSE2_OBJECT *) Op)->Data,
761 ((ACPI_PARSE2_OBJECT *) Op)->Length,
762 WalkState);
770 Status = AcpiExCreateMethod (Op->Named.Data,
771 Op->Named.Length, WalkState);
763 }
764 break;
765
766
767 case AML_REGION_OP:
768 /*
769 * The OpRegion is not fully parsed at this time. Only valid argument is the SpaceId.
770 * (We must save the address of the AML of the address and length operands)

--- 17 unchanged lines hidden (view full) ---

788 }
789 break;
790
791
792 case AML_NAME_OP:
793
794 Status = AcpiDsCreateNode (WalkState, Node, Op);
795 break;
772 }
773 break;
774
775
776 case AML_REGION_OP:
777 /*
778 * The OpRegion is not fully parsed at this time. Only valid argument is the SpaceId.
779 * (We must save the address of the AML of the address and length operands)

--- 17 unchanged lines hidden (view full) ---

797 }
798 break;
799
800
801 case AML_NAME_OP:
802
803 Status = AcpiDsCreateNode (WalkState, Node, Op);
804 break;
805
806
807 default:
808 /* All NAMED_COMPLEX opcodes must be handled above */
809 break;
796 }
797 break;
798
799
800 case AML_CLASS_INTERNAL:
801
802 /* case AML_INT_NAMEPATH_OP: */
803 break;
804
805
806 case AML_CLASS_METHOD_CALL:
807
808 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
809 "RESOLVING-MethodCall: State=%p Op=%p NamedObj=%p\n",
810 WalkState, Op, Node));
811
812 /*
813 * Lookup the method name and save the Node
814 */
810 }
811 break;
812
813
814 case AML_CLASS_INTERNAL:
815
816 /* case AML_INT_NAMEPATH_OP: */
817 break;
818
819
820 case AML_CLASS_METHOD_CALL:
821
822 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
823 "RESOLVING-MethodCall: State=%p Op=%p NamedObj=%p\n",
824 WalkState, Op, Node));
825
826 /*
827 * Lookup the method name and save the Node
828 */
815 Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Value.String,
829 Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
816 ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2,
817 ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
818 WalkState, &(NewNode));
819 if (ACPI_SUCCESS (Status))
820 {
821 /*
822 * Make sure that what we found is indeed a method
823 * We didn't search for a method on purpose, to see if the name would resolve
824 */
825 if (NewNode->Type != ACPI_TYPE_METHOD)
826 {
827 Status = AE_AML_OPERAND_TYPE;
828 }
829
830 /* We could put the returned object (Node) on the object stack for later, but
831 * for now, we will put it in the "op" object that the parser uses, so we
832 * can get it again at the end of this scope
833 */
830 ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2,
831 ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
832 WalkState, &(NewNode));
833 if (ACPI_SUCCESS (Status))
834 {
835 /*
836 * Make sure that what we found is indeed a method
837 * We didn't search for a method on purpose, to see if the name would resolve
838 */
839 if (NewNode->Type != ACPI_TYPE_METHOD)
840 {
841 Status = AE_AML_OPERAND_TYPE;
842 }
843
844 /* We could put the returned object (Node) on the object stack for later, but
845 * for now, we will put it in the "op" object that the parser uses, so we
846 * can get it again at the end of this scope
847 */
834 Op->Node = NewNode;
848 Op->Common.Node = NewNode;
835 }
836
837 break;
838
839
840 default:
841 break;
842 }

--- 12 unchanged lines hidden ---
849 }
850
851 break;
852
853
854 default:
855 break;
856 }

--- 12 unchanged lines hidden ---