1 /******************************************************************************
2 *
3 * Module Name: dswexec - Dispatcher method execution callbacks;
4 * dispatch to interpreter.
5 *
6 *****************************************************************************/
7
8 /*
9 * Copyright (C) 2000 - 2011, Intel Corp.
10 * All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions, and the following disclaimer,
17 * without modification.
18 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 * substantially similar to the "NO WARRANTY" disclaimer below
20 * ("Disclaimer") and any redistribution must be conditioned upon
21 * including a substantially similar Disclaimer requirement for further
22 * binary redistribution.
23 * 3. Neither the names of the above-listed copyright holders nor the names
24 * of any contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
26 *
27 * Alternatively, this software may be distributed under the terms of the
28 * GNU General Public License ("GPL") version 2 as published by the Free
29 * Software Foundation.
147 * object. Implicitly convert the argument if necessary.
148 */
149 Status = AcpiExConvertToInteger (ObjDesc, &LocalObjDesc, 16);
150 if (ACPI_FAILURE (Status))
151 {
152 goto Cleanup;
153 }
154
155 if (LocalObjDesc->Common.Type != ACPI_TYPE_INTEGER)
156 {
157 ACPI_ERROR ((AE_INFO,
158 "Bad predicate (not an integer) ObjDesc=%p State=%p Type=0x%X",
159 ObjDesc, WalkState, ObjDesc->Common.Type));
160
161 Status = AE_AML_OPERAND_TYPE;
162 goto Cleanup;
163 }
164
165 /* Truncate the predicate to 32-bits if necessary */
166
167 AcpiExTruncateFor32bitTable (LocalObjDesc);
168
169 /*
170 * Save the result of the predicate evaluation on
171 * the control stack
172 */
173 if (LocalObjDesc->Integer.Value)
174 {
175 WalkState->ControlState->Common.Value = TRUE;
176 }
177 else
178 {
179 /*
180 * Predicate is FALSE, we will just toss the
181 * rest of the package
182 */
183 WalkState->ControlState->Common.Value = FALSE;
184 Status = AE_CTRL_FALSE;
185 }
186
187 /* Predicate can be used for an implicit return value */
301
302 OpcodeClass = WalkState->OpInfo->Class;
303
304 /* We want to send namepaths to the load code */
305
306 if (Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
307 {
308 OpcodeClass = AML_CLASS_NAMED_OBJECT;
309 }
310
311 /*
312 * Handle the opcode based upon the opcode type
313 */
314 switch (OpcodeClass)
315 {
316 case AML_CLASS_CONTROL:
317
318 Status = AcpiDsExecBeginControlOp (WalkState, Op);
319 break;
320
321
322 case AML_CLASS_NAMED_OBJECT:
323
324 if (WalkState->WalkType & ACPI_WALK_METHOD)
325 {
326 /*
327 * Found a named object declaration during method execution;
328 * we must enter this object into the namespace. The created
329 * object is temporary and will be deleted upon completion of
330 * the execution of this method.
331 *
332 * Note 10/2010: Except for the Scope() op. This opcode does
333 * not actually create a new object, it refers to an existing
334 * object. However, for Scope(), we want to indeed open a
335 * new scope.
336 */
337 if (Op->Common.AmlOpcode != AML_SCOPE_OP)
338 {
339 Status = AcpiDsLoad2BeginOp (WalkState, NULL);
340 }
341 else
342 {
343 Status = AcpiDsScopeStackPush (Op->Named.Node,
344 Op->Named.Node->Type, WalkState);
345 if (ACPI_FAILURE (Status))
346 {
347 return_ACPI_STATUS (Status);
348 }
349 }
350 }
351 break;
352
353
354 case AML_CLASS_EXECUTE:
355 case AML_CLASS_CREATE:
356
357 break;
358
359
360 default:
361 break;
362 }
363
364 /* Nothing to do here during method execution */
365
366 return_ACPI_STATUS (Status);
367
368
369 ErrorExit:
370 Status = AcpiDsMethodError (Status, WalkState);
371 return_ACPI_STATUS (Status);
372 }
373
374
375 /*****************************************************************************
376 *
377 * FUNCTION: AcpiDsExecEndOp
378 *
379 * PARAMETERS: WalkState - Current state of the parse tree walk
380 *
424
425 ACPI_DEBUGGER_EXEC (Status = AcpiDbSingleStep (WalkState, Op, OpClass));
426 ACPI_DEBUGGER_EXEC (if (ACPI_FAILURE (Status)) {return_ACPI_STATUS (Status);});
427
428 /* Decode the Opcode Class */
429
430 switch (OpClass)
431 {
432 case AML_CLASS_ARGUMENT: /* Constants, literals, etc. */
433
434 if (WalkState->Opcode == AML_INT_NAMEPATH_OP)
435 {
436 Status = AcpiDsEvaluateNamePath (WalkState);
437 if (ACPI_FAILURE (Status))
438 {
439 goto Cleanup;
440 }
441 }
442 break;
443
444
445 case AML_CLASS_EXECUTE: /* Most operators with arguments */
446
447 /* Build resolved operand stack */
448
449 Status = AcpiDsCreateOperands (WalkState, FirstArg);
450 if (ACPI_FAILURE (Status))
451 {
452 goto Cleanup;
453 }
454
455 /*
456 * All opcodes require operand resolution, with the only exceptions
457 * being the ObjectType and SizeOf operators.
458 */
459 if (!(WalkState->OpInfo->Flags & AML_NO_OPERAND_RESOLVE))
460 {
461 /* Resolve all operands */
462
463 Status = AcpiExResolveOperands (WalkState->Opcode,
464 &(WalkState->Operands [WalkState->NumOperands -1]),
497 "While resolving operands for [%s]",
498 AcpiPsGetOpcodeName (WalkState->Opcode)));
499 }
500 }
501
502 /* Always delete the argument objects and clear the operand stack */
503
504 AcpiDsClearOperands (WalkState);
505
506 /*
507 * If a result object was returned from above, push it on the
508 * current result stack
509 */
510 if (ACPI_SUCCESS (Status) &&
511 WalkState->ResultObj)
512 {
513 Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
514 }
515 break;
516
517
518 default:
519
520 switch (OpType)
521 {
522 case AML_TYPE_CONTROL: /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
523
524 /* 1 Operand, 0 ExternalResult, 0 InternalResult */
525
526 Status = AcpiDsExecEndControlOp (WalkState, Op);
527
528 break;
529
530
531 case AML_TYPE_METHOD_CALL:
532
533 /*
534 * If the method is referenced from within a package
535 * declaration, it is not a invocation of the method, just
536 * a reference to it.
537 */
538 if ((Op->Asl.Parent) &&
539 ((Op->Asl.Parent->Asl.AmlOpcode == AML_PACKAGE_OP) ||
540 (Op->Asl.Parent->Asl.AmlOpcode == AML_VAR_PACKAGE_OP)))
541 {
542 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
543 "Method Reference in a Package, Op=%p\n", Op));
544
545 Op->Common.Node = (ACPI_NAMESPACE_NODE *) Op->Asl.Value.Arg->Asl.Node;
546 AcpiUtAddReference (Op->Asl.Value.Arg->Asl.Node->Object);
547 return_ACPI_STATUS (AE_OK);
548 }
549
550 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", Op));
551
552 /*
553 * (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
554 * the method Node pointer
555 */
556 /* NextOp points to the op that holds the method name */
557
558 NextOp = FirstArg;
559
560 /* NextOp points to first argument op */
561
562 NextOp = NextOp->Common.Next;
563
564 /*
565 * Get the method's arguments and put them on the operand stack
566 */
567 Status = AcpiDsCreateOperands (WalkState, NextOp);
568 if (ACPI_FAILURE (Status))
569 {
570 break;
579 if (ACPI_FAILURE (Status))
580 {
581 /* On error, clear all resolved operands */
582
583 AcpiDsClearOperands (WalkState);
584 break;
585 }
586
587 /*
588 * Tell the walk loop to preempt this running method and
589 * execute the new method
590 */
591 Status = AE_CTRL_TRANSFER;
592
593 /*
594 * Return now; we don't want to disturb anything,
595 * especially the operand count!
596 */
597 return_ACPI_STATUS (Status);
598
599
600 case AML_TYPE_CREATE_FIELD:
601
602 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
603 "Executing CreateField Buffer/Index Op=%p\n", Op));
604
605 Status = AcpiDsLoad2EndOp (WalkState);
606 if (ACPI_FAILURE (Status))
607 {
608 break;
609 }
610
611 Status = AcpiDsEvalBufferFieldOperands (WalkState, Op);
612 break;
613
614
615 case AML_TYPE_CREATE_OBJECT:
616
617 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
618 "Executing CreateObject (Buffer/Package) Op=%p\n", Op));
619
620 switch (Op->Common.Parent->Common.AmlOpcode)
621 {
622 case AML_NAME_OP:
623
624 /*
625 * Put the Node on the object stack (Contains the ACPI Name
626 * of this object)
627 */
628 WalkState->Operands[0] = (void *) Op->Common.Parent->Common.Node;
629 WalkState->NumOperands = 1;
630
631 Status = AcpiDsCreateNode (WalkState,
632 Op->Common.Parent->Common.Node,
633 Op->Common.Parent);
634 if (ACPI_FAILURE (Status))
635 {
636 break;
637 }
638
639 /* Fall through */
640 /*lint -fallthrough */
641
642 case AML_INT_EVAL_SUBTREE_OP:
643
644 Status = AcpiDsEvalDataObjectOperands (WalkState, Op,
645 AcpiNsGetAttachedObject (Op->Common.Parent->Common.Node));
646 break;
647
648 default:
649
650 Status = AcpiDsEvalDataObjectOperands (WalkState, Op, NULL);
651 break;
652 }
653
654 /*
655 * If a result object was returned from above, push it on the
656 * current result stack
657 */
658 if (WalkState->ResultObj)
659 {
660 Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
661 }
662 break;
663
664
665 case AML_TYPE_NAMED_FIELD:
666 case AML_TYPE_NAMED_COMPLEX:
667 case AML_TYPE_NAMED_SIMPLE:
668 case AML_TYPE_NAMED_NO_OBJ:
669
670 Status = AcpiDsLoad2EndOp (WalkState);
671 if (ACPI_FAILURE (Status))
672 {
673 break;
674 }
675
676 if (Op->Common.AmlOpcode == AML_REGION_OP)
677 {
678 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
679 "Executing OpRegion Address/Length Op=%p\n", Op));
680
681 Status = AcpiDsEvalRegionOperands (WalkState, Op);
682 if (ACPI_FAILURE (Status))
683 {
684 break;
691
692 Status = AcpiDsEvalTableRegionOperands (WalkState, Op);
693 if (ACPI_FAILURE (Status))
694 {
695 break;
696 }
697 }
698 else if (Op->Common.AmlOpcode == AML_BANK_FIELD_OP)
699 {
700 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
701 "Executing BankField Op=%p\n", Op));
702
703 Status = AcpiDsEvalBankFieldOperands (WalkState, Op);
704 if (ACPI_FAILURE (Status))
705 {
706 break;
707 }
708 }
709 break;
710
711
712 case AML_TYPE_UNDEFINED:
713
714 ACPI_ERROR ((AE_INFO,
715 "Undefined opcode type Op=%p", Op));
716 return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
717
718
719 case AML_TYPE_BOGUS:
720
721 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
722 "Internal opcode=%X type Op=%p\n",
723 WalkState->Opcode, Op));
724 break;
725
726
727 default:
728
729 ACPI_ERROR ((AE_INFO,
730 "Unimplemented opcode, class=0x%X type=0x%X Opcode=-0x%X Op=%p",
731 OpClass, OpType, Op->Common.AmlOpcode, Op));
732
733 Status = AE_NOT_IMPLEMENTED;
734 break;
735 }
736 }
737
738 /*
739 * ACPI 2.0 support for 64-bit integers: Truncate numeric
740 * result value if we are executing from a 32-bit ACPI table
741 */
742 AcpiExTruncateFor32bitTable (WalkState->ResultObj);
743
744 /*
745 * Check if we just completed the evaluation of a
746 * conditional predicate
747 */
748 if ((ACPI_SUCCESS (Status)) &&
749 (WalkState->ControlState) &&
750 (WalkState->ControlState->Common.State ==
751 ACPI_CONTROL_PREDICATE_EXECUTING) &&
752 (WalkState->ControlState->Control.PredicateOp == Op))
753 {
754 Status = AcpiDsGetPredicateValue (WalkState, WalkState->ResultObj);
755 WalkState->ResultObj = NULL;
756 }
757
758
759 Cleanup:
760
761 if (WalkState->ResultObj)
762 {
776 #ifdef _UNDER_DEVELOPMENT
777
778 if (WalkState->ParserState.Aml == WalkState->ParserState.AmlEnd)
779 {
780 AcpiDbMethodEnd (WalkState);
781 }
782 #endif
783
784 /* Invoke exception handler on error */
785
786 if (ACPI_FAILURE (Status))
787 {
788 Status = AcpiDsMethodError (Status, WalkState);
789 }
790
791 /* Always clear the object stack */
792
793 WalkState->NumOperands = 0;
794 return_ACPI_STATUS (Status);
795 }
796
797
|
1 /******************************************************************************
2 *
3 * Module Name: dswexec - Dispatcher method execution callbacks;
4 * dispatch to interpreter.
5 *
6 *****************************************************************************/
7
8 /*
9 * Copyright (C) 2000 - 2013, Intel Corp.
10 * All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions, and the following disclaimer,
17 * without modification.
18 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 * substantially similar to the "NO WARRANTY" disclaimer below
20 * ("Disclaimer") and any redistribution must be conditioned upon
21 * including a substantially similar Disclaimer requirement for further
22 * binary redistribution.
23 * 3. Neither the names of the above-listed copyright holders nor the names
24 * of any contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
26 *
27 * Alternatively, this software may be distributed under the terms of the
28 * GNU General Public License ("GPL") version 2 as published by the Free
29 * Software Foundation.
147 * object. Implicitly convert the argument if necessary.
148 */
149 Status = AcpiExConvertToInteger (ObjDesc, &LocalObjDesc, 16);
150 if (ACPI_FAILURE (Status))
151 {
152 goto Cleanup;
153 }
154
155 if (LocalObjDesc->Common.Type != ACPI_TYPE_INTEGER)
156 {
157 ACPI_ERROR ((AE_INFO,
158 "Bad predicate (not an integer) ObjDesc=%p State=%p Type=0x%X",
159 ObjDesc, WalkState, ObjDesc->Common.Type));
160
161 Status = AE_AML_OPERAND_TYPE;
162 goto Cleanup;
163 }
164
165 /* Truncate the predicate to 32-bits if necessary */
166
167 (void) AcpiExTruncateFor32bitTable (LocalObjDesc);
168
169 /*
170 * Save the result of the predicate evaluation on
171 * the control stack
172 */
173 if (LocalObjDesc->Integer.Value)
174 {
175 WalkState->ControlState->Common.Value = TRUE;
176 }
177 else
178 {
179 /*
180 * Predicate is FALSE, we will just toss the
181 * rest of the package
182 */
183 WalkState->ControlState->Common.Value = FALSE;
184 Status = AE_CTRL_FALSE;
185 }
186
187 /* Predicate can be used for an implicit return value */
301
302 OpcodeClass = WalkState->OpInfo->Class;
303
304 /* We want to send namepaths to the load code */
305
306 if (Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
307 {
308 OpcodeClass = AML_CLASS_NAMED_OBJECT;
309 }
310
311 /*
312 * Handle the opcode based upon the opcode type
313 */
314 switch (OpcodeClass)
315 {
316 case AML_CLASS_CONTROL:
317
318 Status = AcpiDsExecBeginControlOp (WalkState, Op);
319 break;
320
321 case AML_CLASS_NAMED_OBJECT:
322
323 if (WalkState->WalkType & ACPI_WALK_METHOD)
324 {
325 /*
326 * Found a named object declaration during method execution;
327 * we must enter this object into the namespace. The created
328 * object is temporary and will be deleted upon completion of
329 * the execution of this method.
330 *
331 * Note 10/2010: Except for the Scope() op. This opcode does
332 * not actually create a new object, it refers to an existing
333 * object. However, for Scope(), we want to indeed open a
334 * new scope.
335 */
336 if (Op->Common.AmlOpcode != AML_SCOPE_OP)
337 {
338 Status = AcpiDsLoad2BeginOp (WalkState, NULL);
339 }
340 else
341 {
342 Status = AcpiDsScopeStackPush (Op->Named.Node,
343 Op->Named.Node->Type, WalkState);
344 if (ACPI_FAILURE (Status))
345 {
346 return_ACPI_STATUS (Status);
347 }
348 }
349 }
350 break;
351
352 case AML_CLASS_EXECUTE:
353 case AML_CLASS_CREATE:
354
355 break;
356
357 default:
358
359 break;
360 }
361
362 /* Nothing to do here during method execution */
363
364 return_ACPI_STATUS (Status);
365
366
367 ErrorExit:
368 Status = AcpiDsMethodError (Status, WalkState);
369 return_ACPI_STATUS (Status);
370 }
371
372
373 /*****************************************************************************
374 *
375 * FUNCTION: AcpiDsExecEndOp
376 *
377 * PARAMETERS: WalkState - Current state of the parse tree walk
378 *
422
423 ACPI_DEBUGGER_EXEC (Status = AcpiDbSingleStep (WalkState, Op, OpClass));
424 ACPI_DEBUGGER_EXEC (if (ACPI_FAILURE (Status)) {return_ACPI_STATUS (Status);});
425
426 /* Decode the Opcode Class */
427
428 switch (OpClass)
429 {
430 case AML_CLASS_ARGUMENT: /* Constants, literals, etc. */
431
432 if (WalkState->Opcode == AML_INT_NAMEPATH_OP)
433 {
434 Status = AcpiDsEvaluateNamePath (WalkState);
435 if (ACPI_FAILURE (Status))
436 {
437 goto Cleanup;
438 }
439 }
440 break;
441
442 case AML_CLASS_EXECUTE: /* Most operators with arguments */
443
444 /* Build resolved operand stack */
445
446 Status = AcpiDsCreateOperands (WalkState, FirstArg);
447 if (ACPI_FAILURE (Status))
448 {
449 goto Cleanup;
450 }
451
452 /*
453 * All opcodes require operand resolution, with the only exceptions
454 * being the ObjectType and SizeOf operators.
455 */
456 if (!(WalkState->OpInfo->Flags & AML_NO_OPERAND_RESOLVE))
457 {
458 /* Resolve all operands */
459
460 Status = AcpiExResolveOperands (WalkState->Opcode,
461 &(WalkState->Operands [WalkState->NumOperands -1]),
494 "While resolving operands for [%s]",
495 AcpiPsGetOpcodeName (WalkState->Opcode)));
496 }
497 }
498
499 /* Always delete the argument objects and clear the operand stack */
500
501 AcpiDsClearOperands (WalkState);
502
503 /*
504 * If a result object was returned from above, push it on the
505 * current result stack
506 */
507 if (ACPI_SUCCESS (Status) &&
508 WalkState->ResultObj)
509 {
510 Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
511 }
512 break;
513
514 default:
515
516 switch (OpType)
517 {
518 case AML_TYPE_CONTROL: /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
519
520 /* 1 Operand, 0 ExternalResult, 0 InternalResult */
521
522 Status = AcpiDsExecEndControlOp (WalkState, Op);
523
524 break;
525
526 case AML_TYPE_METHOD_CALL:
527 /*
528 * If the method is referenced from within a package
529 * declaration, it is not a invocation of the method, just
530 * a reference to it.
531 */
532 if ((Op->Asl.Parent) &&
533 ((Op->Asl.Parent->Asl.AmlOpcode == AML_PACKAGE_OP) ||
534 (Op->Asl.Parent->Asl.AmlOpcode == AML_VAR_PACKAGE_OP)))
535 {
536 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
537 "Method Reference in a Package, Op=%p\n", Op));
538
539 Op->Common.Node = (ACPI_NAMESPACE_NODE *) Op->Asl.Value.Arg->Asl.Node;
540 AcpiUtAddReference (Op->Asl.Value.Arg->Asl.Node->Object);
541 return_ACPI_STATUS (AE_OK);
542 }
543
544 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
545 "Method invocation, Op=%p\n", Op));
546
547 /*
548 * (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
549 * the method Node pointer
550 */
551 /* NextOp points to the op that holds the method name */
552
553 NextOp = FirstArg;
554
555 /* NextOp points to first argument op */
556
557 NextOp = NextOp->Common.Next;
558
559 /*
560 * Get the method's arguments and put them on the operand stack
561 */
562 Status = AcpiDsCreateOperands (WalkState, NextOp);
563 if (ACPI_FAILURE (Status))
564 {
565 break;
574 if (ACPI_FAILURE (Status))
575 {
576 /* On error, clear all resolved operands */
577
578 AcpiDsClearOperands (WalkState);
579 break;
580 }
581
582 /*
583 * Tell the walk loop to preempt this running method and
584 * execute the new method
585 */
586 Status = AE_CTRL_TRANSFER;
587
588 /*
589 * Return now; we don't want to disturb anything,
590 * especially the operand count!
591 */
592 return_ACPI_STATUS (Status);
593
594 case AML_TYPE_CREATE_FIELD:
595
596 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
597 "Executing CreateField Buffer/Index Op=%p\n", Op));
598
599 Status = AcpiDsLoad2EndOp (WalkState);
600 if (ACPI_FAILURE (Status))
601 {
602 break;
603 }
604
605 Status = AcpiDsEvalBufferFieldOperands (WalkState, Op);
606 break;
607
608
609 case AML_TYPE_CREATE_OBJECT:
610
611 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
612 "Executing CreateObject (Buffer/Package) Op=%p\n", Op));
613
614 switch (Op->Common.Parent->Common.AmlOpcode)
615 {
616 case AML_NAME_OP:
617 /*
618 * Put the Node on the object stack (Contains the ACPI Name
619 * of this object)
620 */
621 WalkState->Operands[0] = (void *) Op->Common.Parent->Common.Node;
622 WalkState->NumOperands = 1;
623
624 Status = AcpiDsCreateNode (WalkState,
625 Op->Common.Parent->Common.Node,
626 Op->Common.Parent);
627 if (ACPI_FAILURE (Status))
628 {
629 break;
630 }
631
632 /* Fall through */
633 /*lint -fallthrough */
634
635 case AML_INT_EVAL_SUBTREE_OP:
636
637 Status = AcpiDsEvalDataObjectOperands (WalkState, Op,
638 AcpiNsGetAttachedObject (Op->Common.Parent->Common.Node));
639 break;
640
641 default:
642
643 Status = AcpiDsEvalDataObjectOperands (WalkState, Op, NULL);
644 break;
645 }
646
647 /*
648 * If a result object was returned from above, push it on the
649 * current result stack
650 */
651 if (WalkState->ResultObj)
652 {
653 Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
654 }
655 break;
656
657 case AML_TYPE_NAMED_FIELD:
658 case AML_TYPE_NAMED_COMPLEX:
659 case AML_TYPE_NAMED_SIMPLE:
660 case AML_TYPE_NAMED_NO_OBJ:
661
662 Status = AcpiDsLoad2EndOp (WalkState);
663 if (ACPI_FAILURE (Status))
664 {
665 break;
666 }
667
668 if (Op->Common.AmlOpcode == AML_REGION_OP)
669 {
670 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
671 "Executing OpRegion Address/Length Op=%p\n", Op));
672
673 Status = AcpiDsEvalRegionOperands (WalkState, Op);
674 if (ACPI_FAILURE (Status))
675 {
676 break;
683
684 Status = AcpiDsEvalTableRegionOperands (WalkState, Op);
685 if (ACPI_FAILURE (Status))
686 {
687 break;
688 }
689 }
690 else if (Op->Common.AmlOpcode == AML_BANK_FIELD_OP)
691 {
692 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
693 "Executing BankField Op=%p\n", Op));
694
695 Status = AcpiDsEvalBankFieldOperands (WalkState, Op);
696 if (ACPI_FAILURE (Status))
697 {
698 break;
699 }
700 }
701 break;
702
703 case AML_TYPE_UNDEFINED:
704
705 ACPI_ERROR ((AE_INFO,
706 "Undefined opcode type Op=%p", Op));
707 return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
708
709 case AML_TYPE_BOGUS:
710
711 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
712 "Internal opcode=%X type Op=%p\n",
713 WalkState->Opcode, Op));
714 break;
715
716 default:
717
718 ACPI_ERROR ((AE_INFO,
719 "Unimplemented opcode, class=0x%X type=0x%X Opcode=0x%X Op=%p",
720 OpClass, OpType, Op->Common.AmlOpcode, Op));
721
722 Status = AE_NOT_IMPLEMENTED;
723 break;
724 }
725 }
726
727 /*
728 * ACPI 2.0 support for 64-bit integers: Truncate numeric
729 * result value if we are executing from a 32-bit ACPI table
730 */
731 (void) AcpiExTruncateFor32bitTable (WalkState->ResultObj);
732
733 /*
734 * Check if we just completed the evaluation of a
735 * conditional predicate
736 */
737 if ((ACPI_SUCCESS (Status)) &&
738 (WalkState->ControlState) &&
739 (WalkState->ControlState->Common.State ==
740 ACPI_CONTROL_PREDICATE_EXECUTING) &&
741 (WalkState->ControlState->Control.PredicateOp == Op))
742 {
743 Status = AcpiDsGetPredicateValue (WalkState, WalkState->ResultObj);
744 WalkState->ResultObj = NULL;
745 }
746
747
748 Cleanup:
749
750 if (WalkState->ResultObj)
751 {
765 #ifdef _UNDER_DEVELOPMENT
766
767 if (WalkState->ParserState.Aml == WalkState->ParserState.AmlEnd)
768 {
769 AcpiDbMethodEnd (WalkState);
770 }
771 #endif
772
773 /* Invoke exception handler on error */
774
775 if (ACPI_FAILURE (Status))
776 {
777 Status = AcpiDsMethodError (Status, WalkState);
778 }
779
780 /* Always clear the object stack */
781
782 WalkState->NumOperands = 0;
783 return_ACPI_STATUS (Status);
784 }
|