nseval.c (151600) | nseval.c (151937) |
---|---|
1/******************************************************************************* 2 * 3 * Module Name: nseval - Object evaluation interfaces -- includes control 4 * method lookup and execution. | 1/******************************************************************************* 2 * 3 * Module Name: nseval - Object evaluation interfaces -- includes control 4 * method lookup and execution. |
5 * $Revision: 129 $ | 5 * $Revision: 1.134 $ |
6 * 7 ******************************************************************************/ 8 9/****************************************************************************** 10 * 11 * 1. Copyright Notice 12 * | 6 * 7 ******************************************************************************/ 8 9/****************************************************************************** 10 * 11 * 1. Copyright Notice 12 * |
13 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. | 13 * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp. |
14 * All rights reserved. 15 * 16 * 2. License 17 * 18 * 2.1. This is your license from Intel Corp. under its intellectual property 19 * rights. You may have additional license terms from the party that provided 20 * you this software, covering your right to use that party's intellectual 21 * property rights. --- 100 unchanged lines hidden (view full) --- 122#include <contrib/dev/acpica/acparser.h> 123#include <contrib/dev/acpica/acinterp.h> 124#include <contrib/dev/acpica/acnamesp.h> 125 126 127#define _COMPONENT ACPI_NAMESPACE 128 ACPI_MODULE_NAME ("nseval") 129 | 14 * All rights reserved. 15 * 16 * 2. License 17 * 18 * 2.1. This is your license from Intel Corp. under its intellectual property 19 * rights. You may have additional license terms from the party that provided 20 * you this software, covering your right to use that party's intellectual 21 * property rights. --- 100 unchanged lines hidden (view full) --- 122#include <contrib/dev/acpica/acparser.h> 123#include <contrib/dev/acpica/acinterp.h> 124#include <contrib/dev/acpica/acnamesp.h> 125 126 127#define _COMPONENT ACPI_NAMESPACE 128 ACPI_MODULE_NAME ("nseval") 129 |
130/* Local prototypes */ |
|
130 | 131 |
132static ACPI_STATUS 133AcpiNsExecuteControlMethod ( 134 ACPI_PARAMETER_INFO *Info); 135 136static ACPI_STATUS 137AcpiNsGetObjectValue ( 138 ACPI_PARAMETER_INFO *Info); 139 140 |
|
131/******************************************************************************* 132 * 133 * FUNCTION: AcpiNsEvaluateRelative 134 * | 141/******************************************************************************* 142 * 143 * FUNCTION: AcpiNsEvaluateRelative 144 * |
135 * PARAMETERS: Pathname - Name of method to execute, If NULL, the 136 * handle is the object to execute 137 * Info - Method info block | 145 * PARAMETERS: Pathname - Name of method to execute, If NULL, the 146 * handle is the object to execute 147 * Info - Method info block, contains: 148 * ReturnObject - Where to put method's return value (if 149 * any). If NULL, no value is returned. 150 * Params - List of parameters to pass to the method, 151 * terminated by NULL. Params itself may be 152 * NULL if no parameters are being passed. |
138 * 139 * RETURN: Status 140 * | 153 * 154 * RETURN: Status 155 * |
141 * DESCRIPTION: Find and execute the requested method using the handle as a 142 * scope | 156 * DESCRIPTION: Evaluate the object or find and execute the requested method |
143 * 144 * MUTEX: Locks Namespace 145 * 146 ******************************************************************************/ 147 148ACPI_STATUS 149AcpiNsEvaluateRelative ( 150 char *Pathname, --- 82 unchanged lines hidden (view full) --- 233 return_ACPI_STATUS (Status); 234} 235 236 237/******************************************************************************* 238 * 239 * FUNCTION: AcpiNsEvaluateByName 240 * | 157 * 158 * MUTEX: Locks Namespace 159 * 160 ******************************************************************************/ 161 162ACPI_STATUS 163AcpiNsEvaluateRelative ( 164 char *Pathname, --- 82 unchanged lines hidden (view full) --- 247 return_ACPI_STATUS (Status); 248} 249 250 251/******************************************************************************* 252 * 253 * FUNCTION: AcpiNsEvaluateByName 254 * |
241 * PARAMETERS: Pathname - Fully qualified pathname to the object 242 * Info - Contains: | 255 * PARAMETERS: Pathname - Fully qualified pathname to the object 256 * Info - Method info block, contains: |
243 * ReturnObject - Where to put method's return value (if 244 * any). If NULL, no value is returned. 245 * Params - List of parameters to pass to the method, 246 * terminated by NULL. Params itself may be 247 * NULL if no parameters are being passed. 248 * 249 * RETURN: Status 250 * | 257 * ReturnObject - Where to put method's return value (if 258 * any). If NULL, no value is returned. 259 * Params - List of parameters to pass to the method, 260 * terminated by NULL. Params itself may be 261 * NULL if no parameters are being passed. 262 * 263 * RETURN: Status 264 * |
251 * DESCRIPTION: Find and execute the requested method passing the given 252 * parameters | 265 * DESCRIPTION: Evaluate the object or rind and execute the requested method 266 * passing the given parameters |
253 * 254 * MUTEX: Locks Namespace 255 * 256 ******************************************************************************/ 257 258ACPI_STATUS 259AcpiNsEvaluateByName ( 260 char *Pathname, --- 60 unchanged lines hidden (view full) --- 321 return_ACPI_STATUS (Status); 322} 323 324 325/******************************************************************************* 326 * 327 * FUNCTION: AcpiNsEvaluateByHandle 328 * | 267 * 268 * MUTEX: Locks Namespace 269 * 270 ******************************************************************************/ 271 272ACPI_STATUS 273AcpiNsEvaluateByName ( 274 char *Pathname, --- 60 unchanged lines hidden (view full) --- 335 return_ACPI_STATUS (Status); 336} 337 338 339/******************************************************************************* 340 * 341 * FUNCTION: AcpiNsEvaluateByHandle 342 * |
329 * PARAMETERS: Handle - Method Node to execute 330 * Params - List of parameters to pass to the method, 331 * terminated by NULL. Params itself may be | 343 * PARAMETERS: Info - Method info block, contains: 344 * Node - Method/Object Node to execute 345 * Parameters - List of parameters to pass to the method, 346 * terminated by NULL. Params itself may be |
332 * NULL if no parameters are being passed. | 347 * NULL if no parameters are being passed. |
333 * ParamType - Type of Parameter list 334 * ReturnObject - Where to put method's return value (if 335 * any). If NULL, no value is returned. | 348 * ReturnObject - Where to put method's return value (if 349 * any). If NULL, no value is returned. 350 * ParameterType - Type of Parameter list 351 * ReturnObject - Where to put method's return value (if 352 * any). If NULL, no value is returned. |
336 * 337 * RETURN: Status 338 * | 353 * 354 * RETURN: Status 355 * |
339 * DESCRIPTION: Execute the requested method passing the given parameters | 356 * DESCRIPTION: Evaluate object or execute the requested method passing the 357 * given parameters |
340 * 341 * MUTEX: Locks Namespace 342 * 343 ******************************************************************************/ 344 345ACPI_STATUS 346AcpiNsEvaluateByHandle ( 347 ACPI_PARAMETER_INFO *Info) --- 85 unchanged lines hidden (view full) --- 433 return_ACPI_STATUS (Status); 434} 435 436 437/******************************************************************************* 438 * 439 * FUNCTION: AcpiNsExecuteControlMethod 440 * | 358 * 359 * MUTEX: Locks Namespace 360 * 361 ******************************************************************************/ 362 363ACPI_STATUS 364AcpiNsEvaluateByHandle ( 365 ACPI_PARAMETER_INFO *Info) --- 85 unchanged lines hidden (view full) --- 451 return_ACPI_STATUS (Status); 452} 453 454 455/******************************************************************************* 456 * 457 * FUNCTION: AcpiNsExecuteControlMethod 458 * |
441 * PARAMETERS: Info - Method info block (w/params) | 459 * PARAMETERS: Info - Method info block, contains: 460 * Node - Method Node to execute 461 * ObjDesc - Method object 462 * Parameters - List of parameters to pass to the method, 463 * terminated by NULL. Params itself may be 464 * NULL if no parameters are being passed. 465 * ReturnObject - Where to put method's return value (if 466 * any). If NULL, no value is returned. 467 * ParameterType - Type of Parameter list 468 * ReturnObject - Where to put method's return value (if 469 * any). If NULL, no value is returned. |
442 * 443 * RETURN: Status 444 * 445 * DESCRIPTION: Execute the requested method passing the given parameters 446 * 447 * MUTEX: Assumes namespace is locked 448 * 449 ******************************************************************************/ 450 | 470 * 471 * RETURN: Status 472 * 473 * DESCRIPTION: Execute the requested method passing the given parameters 474 * 475 * MUTEX: Assumes namespace is locked 476 * 477 ******************************************************************************/ 478 |
451ACPI_STATUS | 479static ACPI_STATUS |
452AcpiNsExecuteControlMethod ( 453 ACPI_PARAMETER_INFO *Info) 454{ 455 ACPI_STATUS Status; | 480AcpiNsExecuteControlMethod ( 481 ACPI_PARAMETER_INFO *Info) 482{ 483 ACPI_STATUS Status; |
456 ACPI_OPERAND_OBJECT *ObjDesc; | |
457 458 459 ACPI_FUNCTION_TRACE ("NsExecuteControlMethod"); 460 461 462 /* Verify that there is a method associated with this object */ 463 | 484 485 486 ACPI_FUNCTION_TRACE ("NsExecuteControlMethod"); 487 488 489 /* Verify that there is a method associated with this object */ 490 |
464 ObjDesc = AcpiNsGetAttachedObject (Info->Node); 465 if (!ObjDesc) | 491 Info->ObjDesc = AcpiNsGetAttachedObject (Info->Node); 492 if (!Info->ObjDesc) |
466 { 467 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No attached method object\n")); 468 469 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); 470 return_ACPI_STATUS (AE_NULL_OBJECT); 471 } 472 473 ACPI_DUMP_PATHNAME (Info->Node, "Execute Method:", 474 ACPI_LV_INFO, _COMPONENT); 475 476 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Method at AML address %p Length %X\n", | 493 { 494 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No attached method object\n")); 495 496 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); 497 return_ACPI_STATUS (AE_NULL_OBJECT); 498 } 499 500 ACPI_DUMP_PATHNAME (Info->Node, "Execute Method:", 501 ACPI_LV_INFO, _COMPONENT); 502 503 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Method at AML address %p Length %X\n", |
477 ObjDesc->Method.AmlStart + 1, ObjDesc->Method.AmlLength - 1)); | 504 Info->ObjDesc->Method.AmlStart + 1, Info->ObjDesc->Method.AmlLength - 1)); |
478 479 /* 480 * Unlock the namespace before execution. This allows namespace access 481 * via the external Acpi* interfaces while a method is being executed. 482 * However, any namespace deletion must acquire both the namespace and 483 * interpreter locks to ensure that no thread is using the portion of the 484 * namespace that is being deleted. 485 */ --- 8 unchanged lines hidden (view full) --- 494 * here before calling into the AML parser 495 */ 496 Status = AcpiExEnterInterpreter (); 497 if (ACPI_FAILURE (Status)) 498 { 499 return_ACPI_STATUS (Status); 500 } 501 | 505 506 /* 507 * Unlock the namespace before execution. This allows namespace access 508 * via the external Acpi* interfaces while a method is being executed. 509 * However, any namespace deletion must acquire both the namespace and 510 * interpreter locks to ensure that no thread is using the portion of the 511 * namespace that is being deleted. 512 */ --- 8 unchanged lines hidden (view full) --- 521 * here before calling into the AML parser 522 */ 523 Status = AcpiExEnterInterpreter (); 524 if (ACPI_FAILURE (Status)) 525 { 526 return_ACPI_STATUS (Status); 527 } 528 |
502 Status = AcpiPsxExecute (Info); | 529 Status = AcpiPsExecuteMethod (Info); |
503 AcpiExExitInterpreter (); 504 505 return_ACPI_STATUS (Status); 506} 507 508 509/******************************************************************************* 510 * 511 * FUNCTION: AcpiNsGetObjectValue 512 * | 530 AcpiExExitInterpreter (); 531 532 return_ACPI_STATUS (Status); 533} 534 535 536/******************************************************************************* 537 * 538 * FUNCTION: AcpiNsGetObjectValue 539 * |
513 * PARAMETERS: Info - Method info block (w/params) | 540 * PARAMETERS: Info - Method info block, contains: 541 * Node - Object's NS node 542 * ReturnObject - Where to put object value (if 543 * any). If NULL, no value is returned. |
514 * 515 * RETURN: Status 516 * 517 * DESCRIPTION: Return the current value of the object 518 * 519 * MUTEX: Assumes namespace is locked, leaves namespace unlocked 520 * 521 ******************************************************************************/ 522 | 544 * 545 * RETURN: Status 546 * 547 * DESCRIPTION: Return the current value of the object 548 * 549 * MUTEX: Assumes namespace is locked, leaves namespace unlocked 550 * 551 ******************************************************************************/ 552 |
523ACPI_STATUS | 553static ACPI_STATUS |
524AcpiNsGetObjectValue ( 525 ACPI_PARAMETER_INFO *Info) 526{ 527 ACPI_STATUS Status = AE_OK; 528 ACPI_NAMESPACE_NODE *ResolvedNode = Info->Node; 529 530 531 ACPI_FUNCTION_TRACE ("NsGetObjectValue"); --- 55 unchanged lines hidden --- | 554AcpiNsGetObjectValue ( 555 ACPI_PARAMETER_INFO *Info) 556{ 557 ACPI_STATUS Status = AE_OK; 558 ACPI_NAMESPACE_NODE *ResolvedNode = Info->Node; 559 560 561 ACPI_FUNCTION_TRACE ("NsGetObjectValue"); --- 55 unchanged lines hidden --- |