1/*******************************************************************************
2 *
3 * Module Name: nseval - Object evaluation interfaces -- includes control
4 * method lookup and execution.
5 * $Revision: 124 $
6 *
7 ******************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
--- 138 unchanged lines hidden (view full) ---
152
153ACPI_STATUS
154AcpiNsEvaluateRelative (
155 ACPI_NAMESPACE_NODE *Handle,
156 char *Pathname,
157 ACPI_OPERAND_OBJECT **Params,
158 ACPI_OPERAND_OBJECT **ReturnObject)
159{
160 ACPI_STATUS Status;
161 ACPI_NAMESPACE_NODE *PrefixNode;
162 ACPI_NAMESPACE_NODE *Node = NULL;
163 ACPI_GENERIC_STATE *ScopeInfo;
164 char *InternalPath = NULL;
165
166
167 ACPI_FUNCTION_TRACE ("NsEvaluateRelative");
168
169
170 /*
171 * Must have a valid object handle
172 */
--- 5 unchanged lines hidden (view full) ---
178 /* Build an internal name string for the method */
179
180 Status = AcpiNsInternalizeName (Pathname, &InternalPath);
181 if (ACPI_FAILURE (Status))
182 {
183 return_ACPI_STATUS (Status);
184 }
185
186 ScopeInfo = AcpiUtCreateGenericState ();
187 if (!ScopeInfo)
188 {
189 goto Cleanup1;
190 }
191
192 /* Get the prefix handle and Node */
193
194 Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
195 if (ACPI_FAILURE (Status))
196 {
197 goto Cleanup;
198 }
199
200 PrefixNode = AcpiNsMapHandleToNode (Handle);
201 if (!PrefixNode)
202 {
203 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
204 Status = AE_BAD_PARAMETER;
205 goto Cleanup;
206 }
207
208 /* Lookup the name in the namespace */
209
210 ScopeInfo->Scope.Node = PrefixNode;
211 Status = AcpiNsLookup (ScopeInfo, InternalPath, ACPI_TYPE_ANY,
212 ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH, NULL,
213 &Node);
214
215 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
216
217 if (ACPI_FAILURE (Status))
218 {
219 ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Object [%s] not found [%s]\n",
--- 9 unchanged lines hidden (view full) ---
229 Pathname, Node, AcpiNsGetAttachedObject (Node)));
230
231 Status = AcpiNsEvaluateByHandle (Node, Params, ReturnObject);
232
233 ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "*** Completed eval of object %s ***\n",
234 Pathname));
235
236Cleanup:
237 AcpiUtDeleteGenericState (ScopeInfo);
238
239Cleanup1:
240 ACPI_MEM_FREE (InternalPath);
241 return_ACPI_STATUS (Status);
242}
243
244
245/*******************************************************************************
246 *
247 * FUNCTION: AcpiNsEvaluateByName
--- 375 unchanged lines hidden ---
2 *
3 * Module Name: nseval - Object evaluation interfaces -- includes control
4 * method lookup and execution.
5 * $Revision: 124 $
6 *
7 ******************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
--- 138 unchanged lines hidden (view full) ---
152
153ACPI_STATUS
154AcpiNsEvaluateRelative (
155 ACPI_NAMESPACE_NODE *Handle,
156 char *Pathname,
157 ACPI_OPERAND_OBJECT **Params,
158 ACPI_OPERAND_OBJECT **ReturnObject)
159{
160 ACPI_STATUS Status;
161 ACPI_NAMESPACE_NODE *PrefixNode;
162 ACPI_NAMESPACE_NODE *Node = NULL;
163 ACPI_GENERIC_STATE *ScopeInfo;
164 char *InternalPath = NULL;
165
166
167 ACPI_FUNCTION_TRACE ("NsEvaluateRelative");
168
169
170 /*
171 * Must have a valid object handle
172 */
--- 5 unchanged lines hidden (view full) ---
178 /* Build an internal name string for the method */
179
180 Status = AcpiNsInternalizeName (Pathname, &InternalPath);
181 if (ACPI_FAILURE (Status))
182 {
183 return_ACPI_STATUS (Status);
184 }
185
186 ScopeInfo = AcpiUtCreateGenericState ();
187 if (!ScopeInfo)
188 {
189 goto Cleanup1;
190 }
191
192 /* Get the prefix handle and Node */
193
194 Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
195 if (ACPI_FAILURE (Status))
196 {
197 goto Cleanup;
198 }
199
200 PrefixNode = AcpiNsMapHandleToNode (Handle);
201 if (!PrefixNode)
202 {
203 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
204 Status = AE_BAD_PARAMETER;
205 goto Cleanup;
206 }
207
208 /* Lookup the name in the namespace */
209
210 ScopeInfo->Scope.Node = PrefixNode;
211 Status = AcpiNsLookup (ScopeInfo, InternalPath, ACPI_TYPE_ANY,
212 ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH, NULL,
213 &Node);
214
215 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
216
217 if (ACPI_FAILURE (Status))
218 {
219 ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Object [%s] not found [%s]\n",
--- 9 unchanged lines hidden (view full) ---
229 Pathname, Node, AcpiNsGetAttachedObject (Node)));
230
231 Status = AcpiNsEvaluateByHandle (Node, Params, ReturnObject);
232
233 ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "*** Completed eval of object %s ***\n",
234 Pathname));
235
236Cleanup:
237 AcpiUtDeleteGenericState (ScopeInfo);
238
239Cleanup1:
240 ACPI_MEM_FREE (InternalPath);
241 return_ACPI_STATUS (Status);
242}
243
244
245/*******************************************************************************
246 *
247 * FUNCTION: AcpiNsEvaluateByName
--- 375 unchanged lines hidden ---