Lines Matching refs:method

4  * Module Name: dsmethod - Parser/Interpreter interface - control method parsing
34 * PARAMETERS: node - Namespace Node of the method
39 * DESCRIPTION: Parse a control method AML to scan for control methods that
43 * there is only a problem if the method actually blocks during execution.
46 * detect whether a method will block or not, so we simply mark all suspicious
50 * control method.
68 /* Create/Init a root op for the method parse tree */
70 op = acpi_ps_alloc_op(AML_METHOD_OP, obj_desc->method.aml_start);
88 obj_desc->method.aml_start,
89 obj_desc->method.aml_length, NULL, 0);
98 /* Parse the method, scan for creation of named objects */
138 * Mark the method as serialized. Later code will create a mutex for
139 * this method to enforce serialization.
142 * Sync Level mechanism for this method, even though it is now serialized.
146 walk_state->method_desc->method.sync_level = 0;
147 walk_state->method_desc->method.info_flags |=
156 /* Abort the parse, no need to examine this method any further */
170 * DESCRIPTION: Called on method error. Invoke the global exception handler if
171 * present, dump the method data if the debugger is configured
201 * AE_OK, in which case the executing method will not be aborted.
224 /* Display method locals/args if debugger is present */
238 * PARAMETERS: obj_desc - The method object
242 * DESCRIPTION: Create a mutex object for a serialized control method
269 mutex_desc->mutex.sync_level = method_desc->method.sync_level;
270 method_desc->method.mutex = mutex_desc;
278 * PARAMETERS: method_node - Node of the method
279 * obj_desc - The method object
281 * a method.
285 * DESCRIPTION: Prepare a method for execution. Parses the method if necessary,
286 * increments the thread count, and waits at the method semaphore
308 if (obj_desc->method.thread_count == ACPI_UINT8_MAX) {
315 * If this method is serialized, we need to acquire the method mutex.
317 if (obj_desc->method.info_flags & ACPI_METHOD_SERIALIZED) {
319 * Create a mutex for the method if it is defined to be Serialized
321 * until a method is actually executed, to minimize the object count
323 if (!obj_desc->method.mutex) {
332 * the sync level of the method. This mechanism provides some
335 * If the method was auto-serialized, we just ignore the sync level
339 * Top-level method invocation has no walk state at this point
342 (!(obj_desc->method.
345 obj_desc->method.mutex->mutex.sync_level)) {
347 "Cannot acquire Mutex for method [%4.4s]"
356 * Obtain the method mutex if necessary. Do not acquire mutex for a
360 !obj_desc->method.mutex->mutex.thread_id ||
362 obj_desc->method.mutex->mutex.thread_id)) {
364 * Acquire the method mutex. This releases the interpreter if we
368 acpi_ex_system_wait_mutex(obj_desc->method.mutex->
378 obj_desc->method.mutex->mutex.
382 obj_desc->method.mutex->mutex.thread_id =
387 * serialized method. In the auto case, we have to ignore
388 * the sync level for the method mutex (created for the
392 if (!(obj_desc->method.info_flags &
395 obj_desc->method.sync_level;
398 obj_desc->method.mutex->mutex.
400 obj_desc->method.mutex->mutex.sync_level;
402 obj_desc->method.mutex->mutex.thread_id =
409 obj_desc->method.mutex->mutex.acquisition_depth++;
413 * Allocate an Owner ID for this method, only if this is the first thread
415 * method is invoked recursively.
417 if (!obj_desc->method.owner_id) {
418 status = acpi_ut_allocate_owner_id(&obj_desc->method.owner_id);
425 * Increment the method parse tree thread count since it has been
428 obj_desc->method.thread_count++;
433 /* On error, must release the method mutex (if present) */
435 if (obj_desc->method.mutex) {
436 acpi_os_release_mutex(obj_desc->method.mutex->mutex.os_mutex);
451 * DESCRIPTION: Transfer execution to a called control method
470 "Calling method %p, currentstate=%p\n",
474 * Get the namespace entry for the control method we are about to call
486 /* Init for new method, possibly wait on method mutex */
495 /* Begin method parse/execution. Create a new walk state */
498 acpi_ds_create_walk_state(obj_desc->method.owner_id, NULL, obj_desc,
526 obj_desc->method.aml_start,
527 obj_desc->method.aml_length, info,
542 for (i = 0; i < obj_desc->method.param_count; i++) {
562 "%-26s: %*s%s\n", " Nested method call",
566 /* Invoke an internal method if necessary */
568 if (obj_desc->method.info_flags & ACPI_METHOD_INTERNAL_ONLY) {
570 obj_desc->method.dispatch.implementation(next_walk_state);
586 /* On error, we must terminate the method properly */
598 * PARAMETERS: walk_state - State for preempted method (caller)
599 * return_desc - Return value from the called method
603 * DESCRIPTION: Restart a method that was preempted by another (nested) method
627 /* Did the called method return a value? */
640 /* Save the return value from the previous method */
649 * Save as THIS method's return value in case it is returned
650 * immediately to yet another method
658 * method is "implicitly" returned to the caller, in the absence of an
661 * Just save the last result of the method as the return value.
671 * calling method or remove one reference if the explicit return
686 * walk_state - State associated with the method
690 * DESCRIPTION: Terminate a control method. Delete everything that the method
719 * namespace by the execution of this method. Unless:
720 * 1) This method is a module-level executable code method, in which
722 * 2) There are other threads executing the method, in which case we
725 if (!(method_desc->method.info_flags & ACPI_METHOD_MODULE_LEVEL)
726 && (method_desc->method.thread_count == 1)) {
728 /* Delete any direct children of (created by) this method */
736 * Delete any objects that were created by this method
740 * namespace walk for every control method execution.
742 if (method_desc->method.
746 method.
749 method_desc->method.info_flags &=
755 * If method is serialized, release the mutex and restore the
758 if (method_desc->method.mutex) {
762 method_desc->method.mutex->mutex.acquisition_depth--;
763 if (!method_desc->method.mutex->mutex.acquisition_depth) {
765 method_desc->method.mutex->mutex.
768 acpi_os_release_mutex(method_desc->method.
770 method_desc->method.mutex->mutex.thread_id = 0;
775 /* Decrement the thread count on the method */
777 if (method_desc->method.thread_count) {
778 method_desc->method.thread_count--;
780 ACPI_ERROR((AE_INFO, "Invalid zero thread count in method"));
783 /* Are there any other threads currently executing this method? */
785 if (method_desc->method.thread_count) {
788 * we immediately reuse it for the next thread executing this method
792 method_desc->method.thread_count));
794 /* This is the only executing thread for this method */
797 * Support to dynamically change a method from not_serialized to
798 * Serialized if it appears that the method is incorrectly written and
800 * is if such a method creates namespace objects and blocks. A second
804 * before marking the method as serialized.
806 if (method_desc->method.
809 ACPI_INFO(("Marking method %4.4s as Serialized "
817 * "pending serialized". The probable cause is that the method
820 * The method was created as not_serialized, but it tried to create
823 * marking the method permanently as Serialized when the last
826 method_desc->method.info_flags &=
829 method_desc->method.info_flags |=
832 method_desc->method.sync_level = 0;
838 (method_desc->method.
840 acpi_ut_release_owner_id(&method_desc->method.owner_id);
845 method.node, method_desc, walk_state);