Deleted Added
sdiff udiff text old ( 197104 ) new ( 199337 )
full compact
1/*******************************************************************************
2 *
3 * Module Name: nseval - Object evaluation, includes control method execution
4 *
5 ******************************************************************************/
6
7/******************************************************************************
8 *

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

455 *
456 ******************************************************************************/
457
458static void
459AcpiNsExecModuleCode (
460 ACPI_OPERAND_OBJECT *MethodObj,
461 ACPI_EVALUATE_INFO *Info)
462{
463 ACPI_OPERAND_OBJECT *RootObj;
464 ACPI_STATUS Status;
465
466
467 ACPI_FUNCTION_TRACE (NsExecModuleCode);
468
469
470 /* Initialize the evaluation information block */
471
472 ACPI_MEMSET (Info, 0, sizeof (ACPI_EVALUATE_INFO));
473 Info->PrefixNode = AcpiGbl_RootNode;
474
475 /*
476 * Get the currently attached root object. Add a reference, because the
477 * ref count will be decreased when the method object is installed to
478 * the root node.
479 */
480 RootObj = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
481 AcpiUtAddReference (RootObj);
482
483 /* Install the method (module-level code) in the root node */
484
485 Status = AcpiNsAttachObject (AcpiGbl_RootNode, MethodObj,
486 ACPI_TYPE_METHOD);
487 if (ACPI_FAILURE (Status))
488 {
489 goto Exit;
490 }
491
492 /* Execute the root node as a control method */
493
494 Status = AcpiNsEvaluate (Info);
495
496 ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "Executed module-level code at %p\n",
497 MethodObj->Method.AmlStart));
498
499 /* Detach the temporary method object */
500
501 AcpiNsDetachObject (AcpiGbl_RootNode);
502
503 /* Restore the original root object */
504
505 Status = AcpiNsAttachObject (AcpiGbl_RootNode, RootObj, ACPI_TYPE_DEVICE);
506
507Exit:
508 AcpiUtRemoveReference (RootObj);
509 return_VOID;
510}
511