Deleted Added
full compact
dswexec.c (99146) dswexec.c (99679)
1/******************************************************************************
2 *
3 * Module Name: dswexec - Dispatcher method execution callbacks;
4 * dispatch to interpreter.
1/******************************************************************************
2 *
3 * Module Name: dswexec - Dispatcher method execution callbacks;
4 * dispatch to interpreter.
5 * $Revision: 90 $
5 * $Revision: 94 $
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.

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

127
128
129#define _COMPONENT ACPI_DISPATCHER
130 ACPI_MODULE_NAME ("dswexec")
131
132/*
133 * Dispatch table for opcode classes
134 */
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.

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

127
128
129#define _COMPONENT ACPI_DISPATCHER
130 ACPI_MODULE_NAME ("dswexec")
131
132/*
133 * Dispatch table for opcode classes
134 */
135ACPI_EXECUTE_OP AcpiGbl_OpTypeDispatch [] = {
135static ACPI_EXECUTE_OP AcpiGbl_OpTypeDispatch [] = {
136 AcpiExOpcode_1A_0T_0R,
137 AcpiExOpcode_1A_0T_1R,
138 AcpiExOpcode_1A_1T_0R,
139 AcpiExOpcode_1A_1T_1R,
140 AcpiExOpcode_2A_0T_0R,
141 AcpiExOpcode_2A_0T_1R,
142 AcpiExOpcode_2A_1T_1R,
143 AcpiExOpcode_2A_2T_1R,

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

207
208 return_ACPI_STATUS (AE_AML_NO_OPERAND);
209 }
210
211 /*
212 * Result of predicate evaluation currently must
213 * be a number
214 */
136 AcpiExOpcode_1A_0T_0R,
137 AcpiExOpcode_1A_0T_1R,
138 AcpiExOpcode_1A_1T_0R,
139 AcpiExOpcode_1A_1T_1R,
140 AcpiExOpcode_2A_0T_0R,
141 AcpiExOpcode_2A_0T_1R,
142 AcpiExOpcode_2A_1T_1R,
143 AcpiExOpcode_2A_2T_1R,

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

207
208 return_ACPI_STATUS (AE_AML_NO_OPERAND);
209 }
210
211 /*
212 * Result of predicate evaluation currently must
213 * be a number
214 */
215 if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
215 if (ACPI_GET_OBJECT_TYPE (ObjDesc) != ACPI_TYPE_INTEGER)
216 {
217 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
218 "Bad predicate (not a number) ObjDesc=%p State=%p Type=%X\n",
216 {
217 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
218 "Bad predicate (not a number) ObjDesc=%p State=%p Type=%X\n",
219 ObjDesc, WalkState, ObjDesc->Common.Type));
219 ObjDesc, WalkState, ACPI_GET_OBJECT_TYPE (ObjDesc)));
220
221 Status = AE_AML_OPERAND_TYPE;
222 goto Cleanup;
223 }
224
225 /* Truncate the predicate to 32-bits if necessary */
226
220
221 Status = AE_AML_OPERAND_TYPE;
222 goto Cleanup;
223 }
224
225 /* Truncate the predicate to 32-bits if necessary */
226
227 AcpiExTruncateFor32bitTable (ObjDesc, WalkState);
227 AcpiExTruncateFor32bitTable (ObjDesc);
228
229 /*
230 * Save the result of the predicate evaluation on
231 * the control stack
232 */
233 if (ObjDesc->Integer.Value)
234 {
235 WalkState->ControlState->Common.Value = TRUE;

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

299 Status = AcpiDsLoad2BeginOp (WalkState, OutOp);
300 if (ACPI_FAILURE (Status))
301 {
302 return_ACPI_STATUS (Status);
303 }
304
305 Op = *OutOp;
306 WalkState->Op = Op;
228
229 /*
230 * Save the result of the predicate evaluation on
231 * the control stack
232 */
233 if (ObjDesc->Integer.Value)
234 {
235 WalkState->ControlState->Common.Value = TRUE;

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

299 Status = AcpiDsLoad2BeginOp (WalkState, OutOp);
300 if (ACPI_FAILURE (Status))
301 {
302 return_ACPI_STATUS (Status);
303 }
304
305 Op = *OutOp;
306 WalkState->Op = Op;
307 WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Opcode);
308 WalkState->Opcode = Op->Opcode;
307 WalkState->Opcode = Op->Common.AmlOpcode;
308 WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
309
310 if (AcpiNsOpensScope (WalkState->OpInfo->ObjectType))
311 {
312 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n",
313 AcpiUtGetTypeName (WalkState->OpInfo->ObjectType), Op));
309
310 if (AcpiNsOpensScope (WalkState->OpInfo->ObjectType))
311 {
312 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n",
313 AcpiUtGetTypeName (WalkState->OpInfo->ObjectType), Op));
314 AcpiDsScopeStackPop (WalkState);
314
315 Status = AcpiDsScopeStackPop (WalkState);
316 if (ACPI_FAILURE (Status))
317 {
318 return_ACPI_STATUS (Status);
319 }
315 }
316 }
317
318 if (Op == WalkState->Origin)
319 {
320 if (OutOp)
321 {
322 *OutOp = Op;

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

344 WalkState->ControlState->Control.PredicateOp = Op;
345 }
346
347
348 OpcodeClass = WalkState->OpInfo->Class;
349
350 /* We want to send namepaths to the load code */
351
320 }
321 }
322
323 if (Op == WalkState->Origin)
324 {
325 if (OutOp)
326 {
327 *OutOp = Op;

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

349 WalkState->ControlState->Control.PredicateOp = Op;
350 }
351
352
353 OpcodeClass = WalkState->OpInfo->Class;
354
355 /* We want to send namepaths to the load code */
356
352 if (Op->Opcode == AML_INT_NAMEPATH_OP)
357 if (Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
353 {
354 OpcodeClass = AML_CLASS_NAMED_OBJECT;
355 }
356
357 /*
358 * Handle the opcode based upon the opcode type
359 */
360 switch (OpcodeClass)

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

380 * execution; we must enter this object into the
381 * namespace. The created object is temporary and
382 * will be deleted upon completion of the execution
383 * of this method.
384 */
385 Status = AcpiDsLoad2BeginOp (WalkState, NULL);
386 }
387
358 {
359 OpcodeClass = AML_CLASS_NAMED_OBJECT;
360 }
361
362 /*
363 * Handle the opcode based upon the opcode type
364 */
365 switch (OpcodeClass)

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

385 * execution; we must enter this object into the
386 * namespace. The created object is temporary and
387 * will be deleted upon completion of the execution
388 * of this method.
389 */
390 Status = AcpiDsLoad2BeginOp (WalkState, NULL);
391 }
392
388 if (Op->Opcode == AML_REGION_OP)
393 if (Op->Common.AmlOpcode == AML_REGION_OP)
389 {
390 Status = AcpiDsResultStackPush (WalkState);
391 }
392 break;
393
394
395 case AML_CLASS_EXECUTE:
396 case AML_CLASS_CREATE:

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

446
447
448 Op = WalkState->Op;
449 OpType = WalkState->OpInfo->Type;
450 OpClass = WalkState->OpInfo->Class;
451
452 if (OpClass == AML_CLASS_UNKNOWN)
453 {
394 {
395 Status = AcpiDsResultStackPush (WalkState);
396 }
397 break;
398
399
400 case AML_CLASS_EXECUTE:
401 case AML_CLASS_CREATE:

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

451
452
453 Op = WalkState->Op;
454 OpType = WalkState->OpInfo->Type;
455 OpClass = WalkState->OpInfo->Class;
456
457 if (OpClass == AML_CLASS_UNKNOWN)
458 {
454 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode %X\n", Op->Opcode));
459 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode %X\n", Op->Common.AmlOpcode));
455 return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
456 }
457
460 return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
461 }
462
458 FirstArg = Op->Value.Arg;
463 FirstArg = Op->Common.Value.Arg;
459
460 /* Init the walk state */
461
462 WalkState->NumOperands = 0;
463 WalkState->ReturnDesc = NULL;
464 WalkState->ResultObj = NULL;
465
466 /* Call debugger for single step support (DEBUG build only) */

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

550
551 switch (OpType)
552 {
553 case AML_TYPE_CONTROL: /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
554
555 /* 1 Operand, 0 ExternalResult, 0 InternalResult */
556
557 Status = AcpiDsExecEndControlOp (WalkState, Op);
464
465 /* Init the walk state */
466
467 WalkState->NumOperands = 0;
468 WalkState->ReturnDesc = NULL;
469 WalkState->ResultObj = NULL;
470
471 /* Call debugger for single step support (DEBUG build only) */

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

555
556 switch (OpType)
557 {
558 case AML_TYPE_CONTROL: /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
559
560 /* 1 Operand, 0 ExternalResult, 0 InternalResult */
561
562 Status = AcpiDsExecEndControlOp (WalkState, Op);
563 if (ACPI_FAILURE (Status))
564 {
565 break;
566 }
558
567
559 AcpiDsResultStackPop (WalkState);
568 Status = AcpiDsResultStackPop (WalkState);
560 break;
561
562
563 case AML_TYPE_METHOD_CALL:
564
565 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", Op));
566
567 /*
568 * (AML_METHODCALL) Op->Value->Arg->Node contains
569 * the method Node pointer
570 */
571 /* NextOp points to the op that holds the method name */
572
573 NextOp = FirstArg;
574
575 /* NextOp points to first argument op */
576
569 break;
570
571
572 case AML_TYPE_METHOD_CALL:
573
574 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", Op));
575
576 /*
577 * (AML_METHODCALL) Op->Value->Arg->Node contains
578 * the method Node pointer
579 */
580 /* NextOp points to the op that holds the method name */
581
582 NextOp = FirstArg;
583
584 /* NextOp points to first argument op */
585
577 NextOp = NextOp->Next;
586 NextOp = NextOp->Common.Next;
578
579 /*
580 * Get the method's arguments and put them on the operand stack
581 */
582 Status = AcpiDsCreateOperands (WalkState, NextOp);
583 if (ACPI_FAILURE (Status))
584 {
585 break;

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

624 break;
625
626
627 case AML_TYPE_CREATE_OBJECT:
628
629 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
630 "Executing CreateObject (Buffer/Package) Op=%p\n", Op));
631
587
588 /*
589 * Get the method's arguments and put them on the operand stack
590 */
591 Status = AcpiDsCreateOperands (WalkState, NextOp);
592 if (ACPI_FAILURE (Status))
593 {
594 break;

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

633 break;
634
635
636 case AML_TYPE_CREATE_OBJECT:
637
638 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
639 "Executing CreateObject (Buffer/Package) Op=%p\n", Op));
640
632 switch (Op->Parent->Opcode)
641 switch (Op->Common.Parent->Common.AmlOpcode)
633 {
634 case AML_NAME_OP:
635
636 /*
637 * Put the Node on the object stack (Contains the ACPI Name of
638 * this object)
639 */
642 {
643 case AML_NAME_OP:
644
645 /*
646 * Put the Node on the object stack (Contains the ACPI Name of
647 * this object)
648 */
640 WalkState->Operands[0] = (void *) Op->Parent->Node;
649 WalkState->Operands[0] = (void *) Op->Common.Parent->Common.Node;
641 WalkState->NumOperands = 1;
642
650 WalkState->NumOperands = 1;
651
643 Status = AcpiDsCreateNode (WalkState, Op->Parent->Node, Op->Parent);
652 Status = AcpiDsCreateNode (WalkState, Op->Common.Parent->Common.Node, Op->Common.Parent);
644 if (ACPI_FAILURE (Status))
645 {
646 break;
647 }
648
649 /* Fall through */
653 if (ACPI_FAILURE (Status))
654 {
655 break;
656 }
657
658 /* Fall through */
659 /*lint -fallthrough */
650
651 case AML_INT_EVAL_SUBTREE_OP:
652
660
661 case AML_INT_EVAL_SUBTREE_OP:
662
653 Status = AcpiDsEvalDataObjectOperands (WalkState, Op, AcpiNsGetAttachedObject (Op->Parent->Node));
663 Status = AcpiDsEvalDataObjectOperands (WalkState, Op,
664 AcpiNsGetAttachedObject (Op->Common.Parent->Common.Node));
654 break;
655
656 default:
657
658 Status = AcpiDsEvalDataObjectOperands (WalkState, Op, NULL);
659 break;
660 }
661

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

677 case AML_TYPE_NAMED_NO_OBJ:
678
679 Status = AcpiDsLoad2EndOp (WalkState);
680 if (ACPI_FAILURE (Status))
681 {
682 break;
683 }
684
665 break;
666
667 default:
668
669 Status = AcpiDsEvalDataObjectOperands (WalkState, Op, NULL);
670 break;
671 }
672

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

688 case AML_TYPE_NAMED_NO_OBJ:
689
690 Status = AcpiDsLoad2EndOp (WalkState);
691 if (ACPI_FAILURE (Status))
692 {
693 break;
694 }
695
685 if (Op->Opcode == AML_REGION_OP)
696 if (Op->Common.AmlOpcode == AML_REGION_OP)
686 {
687 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
688 "Executing OpRegion Address/Length Op=%p\n", Op));
689
690 Status = AcpiDsEvalRegionOperands (WalkState, Op);
691 if (ACPI_FAILURE (Status))
692 {
693 break;

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

712 WalkState->Opcode, Op));
713 break;
714
715
716 default:
717
718 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
719 "Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p\n",
697 {
698 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
699 "Executing OpRegion Address/Length Op=%p\n", Op));
700
701 Status = AcpiDsEvalRegionOperands (WalkState, Op);
702 if (ACPI_FAILURE (Status))
703 {
704 break;

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

723 WalkState->Opcode, Op));
724 break;
725
726
727 default:
728
729 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
730 "Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p\n",
720 OpClass, OpType, Op->Opcode, Op));
731 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 */
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 */
731 AcpiExTruncateFor32bitTable (WalkState->ResultObj, WalkState);
742 AcpiExTruncateFor32bitTable (WalkState->ResultObj);
732
733 /*
734 * Check if we just completed the evaluation of a
735 * conditional predicate
736 */
737
738 if ((WalkState->ControlState) &&
739 (WalkState->ControlState->Common.State ==

--- 30 unchanged lines hidden ---
743
744 /*
745 * Check if we just completed the evaluation of a
746 * conditional predicate
747 */
748
749 if ((WalkState->ControlState) &&
750 (WalkState->ControlState->Common.State ==

--- 30 unchanged lines hidden ---