Home | History | Annotate | Download | only in dispatcher

Lines Matching refs:Method

3  * Module Name: dsmethod - Parser/Interpreter interface - control method parsing
181 * PARAMETERS: Node - Namespace Node of the method
182 * ObjDesc - Method object attached to node
186 * DESCRIPTION: Parse a control method AML to scan for control methods that
190 * there is only a problem if the method actually blocks during execution.
193 * detect whether a method will block or not, so we simply mark all suspicious
197 * control method.
215 "Method auto-serialization parse [%4.4s] %p\n",
218 /* Create/Init a root op for the method parse tree */
220 Op = AcpiPsAllocOp (AML_METHOD_OP, ObjDesc->Method.AmlStart);
239 ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength, NULL, 0);
249 /* Parse the method, scan for creation of named objects */
291 * Mark the method as serialized. Later code will create a mutex for
292 * this method to enforce serialization.
295 * Sync Level mechanism for this method, even though it is now serialized.
299 WalkState->MethodDesc->Method.SyncLevel = 0;
300 WalkState->MethodDesc->Method.InfoFlags |=
304 "Method serialized [%4.4s] %p - [%s] (%4.4X)\n",
308 /* Abort the parse, no need to examine this method any further */
323 * DESCRIPTION: Called on method error. Invoke the global exception handler if
324 * present, dump the method data if the debugger is configured
360 * AE_OK, in which case the executing method will not be aborted.
385 /* Display method locals/args if debugger is present */
400 * PARAMETERS: ObjDesc - The method object
404 * DESCRIPTION: Create a mutex object for a serialized control method
436 Method.SyncLevel;
437 MethodDesc->Method.Mutex = MutexDesc;
446 * PARAMETERS: MethodNode - Node of the method
447 * ObjDesc - The method object
449 * a method.
453 * DESCRIPTION: Prepare a method for execution. Parses the method if necessary,
454 * increments the thread count, and waits at the method semaphore
480 if (ObjDesc->Method.ThreadCount == ACPI_UINT8_MAX)
483 "Method reached maximum reentrancy limit (255)"));
488 * If this method is serialized, we need to acquire the method mutex.
490 if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)
493 * Create a mutex for the method if it is defined to be Serialized
495 * until a method is actually executed, to minimize the object count
497 if (!ObjDesc->Method.Mutex)
508 * the sync level of the method. This mechanism provides some
511 * If the method was auto-serialized, we just ignore the sync level
515 * Top-level method invocation has no walk state at this point
518 (!(ObjDesc->Method.InfoFlags & ACPI_METHOD_IGNORE_SYNC_LEVEL)) &&
520 ObjDesc->Method.Mutex->Mutex.SyncLevel))
523 "Cannot acquire Mutex for method [%4.4s]"
532 * Obtain the method mutex if necessary. Do not acquire mutex for a
536 !ObjDesc->Method.Mutex->Mutex.ThreadId ||
538 ObjDesc->Method.Mutex->Mutex.ThreadId))
541 * Acquire the method mutex. This releases the interpreter if we
545 ObjDesc->Method.Mutex->Mutex.OsMutex, ACPI_WAIT_FOREVER);
555 ObjDesc->Method.Mutex->Mutex.OriginalSyncLevel =
558 ObjDesc->Method.Mutex->Mutex.ThreadId =
563 * serialized method. In the auto case, we have to ignore
564 * the sync level for the method mutex (created for the
568 if (!(ObjDesc->Method.InfoFlags &
572 ObjDesc->Method.SyncLevel;
577 ObjDesc->Method.Mutex->Mutex.OriginalSyncLevel =
578 ObjDesc->Method.Mutex->Mutex.SyncLevel;
580 ObjDesc->Method.Mutex->Mutex.ThreadId =
587 ObjDesc->Method.Mutex->Mutex.AcquisitionDepth++;
591 * Allocate an Owner ID for this method, only if this is the first thread
593 * method is invoked recursively.
595 if (!ObjDesc->Method.OwnerId)
597 Status = AcpiUtAllocateOwnerId (&ObjDesc->Method.OwnerId);
605 * Increment the method parse tree thread count since it has been
608 ObjDesc->Method.ThreadCount++;
614 /* On error, must release the method mutex (if present) */
616 if (ObjDesc->Method.Mutex)
618 AcpiOsReleaseMutex (ObjDesc->Method.Mutex->Mutex.OsMutex);
634 * DESCRIPTION: Transfer execution to a called control method
653 "Calling method %p, currentstate=%p\n",
657 * Get the namespace entry for the control method we are about to call
671 if (ThisWalkState->NumOperands < ObjDesc->Method.ParamCount)
673 ACPI_ERROR ((AE_INFO, "Missing argument(s) for method [%4.4s]",
679 else if (ThisWalkState->NumOperands > ObjDesc->Method.ParamCount)
681 ACPI_ERROR ((AE_INFO, "Too many arguments for method [%4.4s]",
688 /* Init for new method, possibly wait on method mutex */
697 /* Begin method parse/execution. Create a new walk state */
700 ObjDesc->Method.OwnerId, NULL, ObjDesc, Thread);
729 ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength,
756 "%-26s: %*s%s\n", " Nested method call",
760 /* Invoke an internal method if necessary */
762 if (ObjDesc->Method.InfoFlags & ACPI_METHOD_INTERNAL_ONLY)
764 Status = ObjDesc->Method.Dispatch.Implementation (NextWalkState);
782 /* On error, we must terminate the method properly */
795 * PARAMETERS: WalkState - State for preempted method (caller)
796 * ReturnDesc - Return value from the called method
800 * DESCRIPTION: Restart a method that was preempted by another (nested) method
827 /* Did the called method return a value? */
839 /* Save the return value from the previous method */
849 * Save as THIS method's return value in case it is returned
850 * immediately to yet another method
858 * method is "implicitly" returned to the caller, in the absence of an
861 * Just save the last result of the method as the return value.
871 * calling method or remove one reference if the explicit return
886 * PARAMETERS: MethodDesc - Method object
887 * WalkState - State associated with the method
891 * DESCRIPTION: Terminate a control method. Delete everything that the method
923 * namespace by the execution of this method. Unless:
924 * 1) This method is a module-level executable code method, in which
926 * 2) There are other threads executing the method, in which case we
929 if (!(MethodDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL) &&
930 (MethodDesc->Method.ThreadCount == 1))
932 /* Delete any direct children of (created by) this method */
939 * Delete any objects that were created by this method
943 * namespace walk for every control method execution.
945 if (MethodDesc->Method.InfoFlags & ACPI_METHOD_MODIFIED_NAMESPACE)
948 AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
950 Method.InfoFlags &=
956 * If method is serialized, release the mutex and restore the
959 if (MethodDesc->Method.Mutex)
963 MethodDesc->Method.Mutex->Mutex.AcquisitionDepth--;
964 if (!MethodDesc->Method.Mutex->Mutex.AcquisitionDepth)
967 MethodDesc->Method.Mutex->Mutex.OriginalSyncLevel;
970 MethodDesc->Method.Mutex->Mutex.OsMutex);
971 MethodDesc->Method.Mutex->Mutex.ThreadId = 0;
976 /* Decrement the thread count on the method */
978 if (MethodDesc->Method.ThreadCount)
980 MethodDesc->Method.ThreadCount--;
985 "Invalid zero thread count in method"));
988 /* Are there any other threads currently executing this method? */
990 if (MethodDesc->Method.ThreadCount)
994 * we immediately reuse it for the next thread executing this method
998 MethodDesc->Method.ThreadCount));
1002 /* This is the only executing thread for this method */
1005 * Support to dynamically change a method from NotSerialized to
1006 * Serialized if it appears that the method is incorrectly written and
1008 * is if such a method creates namespace objects and blocks. A second
1012 * before marking the method as serialized.
1014 if (MethodDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED_PENDING)
1019 "Marking method %4.4s as Serialized "
1025 * Method tried to create an object twice and was marked as
1026 * "pending serialized". The probable cause is that the method
1029 * The method was created as NotSerialized, but it tried to create
1032 * marking the method permanently as Serialized when the last
1035 MethodDesc->Method.InfoFlags &=
1038 MethodDesc->Method.InfoFlags |=
1040 MethodDesc->Method.SyncLevel = 0;
1045 if (!(MethodDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL))
1047 AcpiUtReleaseOwnerId (&MethodDesc->Method.OwnerId);
1051 AcpiExStopTraceMethod ((ACPI_NAMESPACE_NODE *) MethodDesc->Method.Node,