Lines Matching +full:permanently +full:- +full:attached

3  * Module Name: dsmethod - Parser/Interpreter interface - control method parsing
11 * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
108 * any of its subsidiaries will export/re-export any technical data, process,
130 * 3. Neither the names of the above-listed copyright holders nor the names
181 * PARAMETERS: Node - Namespace Node of the method
182 * ObjDesc - Method object attached to node
215 "Method auto-serialization parse [%4.4s] %p\n",
220 Op = AcpiPsAllocOp (AML_METHOD_OP, ObjDesc->Method.AmlStart);
226 AcpiPsSetName (Op, Node->Name.Integer);
227 Op->Common.Node = Node;
231 WalkState = AcpiDsCreateWalkState (Node->OwnerId, NULL, NULL, NULL);
239 ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength, NULL, 0);
247 WalkState->DescendingCallback = AcpiDsDetectNamedOpcodes;
262 * PARAMETERS: WalkState - Current state of the parse tree walk
263 * OutOp - Unused, required for parser interface
284 if (!(WalkState->OpInfo->Flags & (AML_NAMED | AML_CREATE | AML_FIELD)))
299 WalkState->MethodDesc->Method.SyncLevel = 0;
300 WalkState->MethodDesc->Method.InfoFlags |=
304 "Method serialized [%4.4s] %p - [%s] (%4.4X)\n",
305 WalkState->MethodNode->Name.Ascii, WalkState->MethodNode,
306 WalkState->OpInfo->Name, WalkState->Opcode));
318 * PARAMETERS: Status - Execution status
319 * WalkState - Current state
362 AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml,
363 WalkState->ParserState.AmlStart);
365 if (WalkState->MethodNode)
367 Name = WalkState->MethodNode->Name.Integer;
369 else if (WalkState->DeferredNode)
371 Name = WalkState->DeferredNode->Name.Integer;
375 WalkState->Opcode, AmlOffset, NULL);
383 AcpiDsDumpMethodStack (Status, WalkState, WalkState->Op);
400 * PARAMETERS: ObjDesc - The method object
429 Status = AcpiOsCreateMutex (&MutexDesc->Mutex.OsMutex);
436 MutexDesc->Mutex.SyncLevel = MethodDesc->Method.SyncLevel;
437 MethodDesc->Method.Mutex = MutexDesc;
446 * PARAMETERS: MethodNode - Node of the method
447 * ObjDesc - The method object
448 * WalkState - current state, NULL if not yet executing
480 if (ObjDesc->Method.ThreadCount == ACPI_UINT8_MAX)
490 if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)
497 if (!ObjDesc->Method.Mutex)
507 * The CurrentSyncLevel (per-thread) must be less than or equal to
511 * If the method was auto-serialized, we just ignore the sync level
512 * mechanism, because auto-serialization of methods can interfere
515 * Top-level method invocation has no walk state at this point
518 (!(ObjDesc->Method.InfoFlags & ACPI_METHOD_IGNORE_SYNC_LEVEL)) &&
519 (WalkState->Thread->CurrentSyncLevel >
520 ObjDesc->Method.Mutex->Mutex.SyncLevel))
526 WalkState->Thread->CurrentSyncLevel));
536 !ObjDesc->Method.Mutex->Mutex.ThreadId ||
537 (WalkState->Thread->ThreadId !=
538 ObjDesc->Method.Mutex->Mutex.ThreadId))
545 ObjDesc->Method.Mutex->Mutex.OsMutex, ACPI_WAIT_FOREVER);
555 ObjDesc->Method.Mutex->Mutex.OriginalSyncLevel =
556 WalkState->Thread->CurrentSyncLevel;
558 ObjDesc->Method.Mutex->Mutex.ThreadId =
559 WalkState->Thread->ThreadId;
562 * Update the current SyncLevel only if this is not an auto-
565 * auto-serialization) because we have no idea of what the
568 if (!(ObjDesc->Method.InfoFlags &
571 WalkState->Thread->CurrentSyncLevel =
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++;
595 if (!ObjDesc->Method.OwnerId)
597 Status = AcpiUtAllocateOwnerId (&ObjDesc->Method.OwnerId);
608 ObjDesc->Method.ThreadCount++;
616 if (ObjDesc->Method.Mutex)
618 AcpiOsReleaseMutex (ObjDesc->Method.Mutex->Mutex.OsMutex);
628 * PARAMETERS: Thread - Info for this thread
629 * ThisWalkState - Current walk state
630 * Op - Current Op to be walked
656 ThisWalkState->PrevOp, ThisWalkState));
661 MethodNode = ThisWalkState->MethodCallNode;
685 ObjDesc->Method.OwnerId, NULL, ObjDesc, Thread);
697 ThisWalkState->Operands [ThisWalkState->NumOperands] = NULL;
711 Info->Parameters = &ThisWalkState->Operands[0];
714 ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength,
723 NextWalkState->MethodNestingDepth = ThisWalkState->MethodNestingDepth + 1;
729 for (i = 0; i < ObjDesc->Method.ParamCount; i++)
731 AcpiUtRemoveReference (ThisWalkState->Operands [i]);
732 ThisWalkState->Operands [i] = NULL;
737 ThisWalkState->NumOperands = 0;
741 MethodNode->Name.Ascii, NextWalkState));
743 ThisWalkState->MethodPathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
744 ThisWalkState->MethodIsNested = TRUE;
749 "%-26s: %*s%s\n", " Nested method call",
750 NextWalkState->MethodNestingDepth * 3, " ",
751 &ThisWalkState->MethodPathname[1]));
755 if (ObjDesc->Method.InfoFlags & ACPI_METHOD_INTERNAL_ONLY)
757 Status = ObjDesc->Method.Dispatch.Implementation (NextWalkState);
788 * PARAMETERS: WalkState - State for preempted method (caller)
789 * ReturnDesc - Return value from the called method
812 AcpiUtGetNodeName (WalkState->MethodNode),
813 WalkState->MethodCallOp, ReturnDesc));
817 WalkState->ReturnUsed,
818 WalkState->Results, WalkState));
826 SameAsImplicitReturn = (WalkState->ImplicitReturnObj == ReturnDesc);
830 if (WalkState->ReturnUsed)
845 WalkState->ReturnDesc = ReturnDesc;
849 * The following code is the optional support for the so-called
879 * PARAMETERS: MethodDesc - Method object
880 * WalkState - State associated with the method
917 * 1) This method is a module-level executable code method, in which
922 if (!(MethodDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL) &&
923 (MethodDesc->Method.ThreadCount == 1))
928 AcpiNsDeleteNamespaceSubtree (WalkState->MethodNode);
938 if (MethodDesc->Method.InfoFlags & ACPI_METHOD_MODIFIED_NAMESPACE)
941 AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
943 MethodDesc->Method.InfoFlags &=
952 if (MethodDesc->Method.Mutex)
956 MethodDesc->Method.Mutex->Mutex.AcquisitionDepth--;
957 if (!MethodDesc->Method.Mutex->Mutex.AcquisitionDepth)
959 WalkState->Thread->CurrentSyncLevel =
960 MethodDesc->Method.Mutex->Mutex.OriginalSyncLevel;
963 MethodDesc->Method.Mutex->Mutex.OsMutex);
964 MethodDesc->Method.Mutex->Mutex.ThreadId = 0;
971 if (MethodDesc->Method.ThreadCount)
973 MethodDesc->Method.ThreadCount--;
983 if (MethodDesc->Method.ThreadCount)
991 MethodDesc->Method.ThreadCount));
1007 if (MethodDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED_PENDING)
1014 WalkState->MethodNode->Name.Ascii));
1025 * marking the method permanently as Serialized when the last
1028 MethodDesc->Method.InfoFlags &=
1031 MethodDesc->Method.InfoFlags |=
1033 MethodDesc->Method.SyncLevel = 0;
1038 if (!(MethodDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL))
1040 AcpiUtReleaseOwnerId (&MethodDesc->Method.OwnerId);
1044 AcpiExStopTraceMethod ((ACPI_NAMESPACE_NODE *) MethodDesc->Method.Node,