diff options
| author | Wim Van Sebroeck <wim@iguana.be> | 2007-05-11 19:03:13 +0000 | 
|---|---|---|
| committer | Wim Van Sebroeck <wim@iguana.be> | 2007-05-11 19:03:13 +0000 | 
| commit | 5c34202b8bf942da411b6599668a76b07449bbfd (patch) | |
| tree | 5719c361321eaddc8e4f1b0c8a7994f0e9a6fdd3 /drivers/acpi/executer/exutils.c | |
| parent | 0d4804b31f91cfbcff6d62af0bc09a893a1c8ae0 (diff) | |
| parent | 1f8a6b658a943b4f04a1fc7b3a420360202c86cd (diff) | |
Merge /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/acpi/executer/exutils.c')
| -rw-r--r-- | drivers/acpi/executer/exutils.c | 104 | 
1 files changed, 84 insertions, 20 deletions
diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c index aea461f3a48..6b0aeccbb69 100644 --- a/drivers/acpi/executer/exutils.c +++ b/drivers/acpi/executer/exutils.c @@ -76,14 +76,15 @@ static u32 acpi_ex_digits_needed(acpi_integer value, u32 base);   *   * PARAMETERS:  None   * - * RETURN:      Status + * RETURN:      None   * - * DESCRIPTION: Enter the interpreter execution region.  Failure to enter - *              the interpreter region is a fatal system error + * DESCRIPTION: Enter the interpreter execution region. Failure to enter + *              the interpreter region is a fatal system error. Used in + *              conjunction with exit_interpreter.   *   ******************************************************************************/ -acpi_status acpi_ex_enter_interpreter(void) +void acpi_ex_enter_interpreter(void)  {  	acpi_status status; @@ -91,31 +92,55 @@ acpi_status acpi_ex_enter_interpreter(void)  	status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER);  	if (ACPI_FAILURE(status)) { -		ACPI_ERROR((AE_INFO, "Could not acquire interpreter mutex")); +		ACPI_ERROR((AE_INFO, +			    "Could not acquire AML Interpreter mutex"));  	} -	return_ACPI_STATUS(status); +	return_VOID;  }  /*******************************************************************************   * - * FUNCTION:    acpi_ex_exit_interpreter + * FUNCTION:    acpi_ex_reacquire_interpreter   *   * PARAMETERS:  None   *   * RETURN:      None   * - * DESCRIPTION: Exit the interpreter execution region + * DESCRIPTION: Reacquire the interpreter execution region from within the + *              interpreter code. Failure to enter the interpreter region is a + *              fatal system error. Used in  conjuction with + *              relinquish_interpreter + * + ******************************************************************************/ + +void acpi_ex_reacquire_interpreter(void) +{ +	ACPI_FUNCTION_TRACE(ex_reacquire_interpreter); + +	/* +	 * If the global serialized flag is set, do not release the interpreter, +	 * since it was not actually released by acpi_ex_relinquish_interpreter. +	 * This forces the interpreter to be single threaded. +	 */ +	if (!acpi_gbl_all_methods_serialized) { +		acpi_ex_enter_interpreter(); +	} + +	return_VOID; +} + +/******************************************************************************* + * + * FUNCTION:    acpi_ex_exit_interpreter + * + * PARAMETERS:  None + * + * RETURN:      None   * - * Cases where the interpreter is unlocked: - *      1) Completion of the execution of a control method - *      2) Method blocked on a Sleep() AML opcode - *      3) Method blocked on an Acquire() AML opcode - *      4) Method blocked on a Wait() AML opcode - *      5) Method blocked to acquire the global lock - *      6) Method blocked to execute a serialized control method that is - *          already executing - *      7) About to invoke a user-installed opregion handler + * DESCRIPTION: Exit the interpreter execution region. This is the top level + *              routine used to exit the interpreter when all processing has + *              been completed.   *   ******************************************************************************/ @@ -127,7 +152,46 @@ void acpi_ex_exit_interpreter(void)  	status = acpi_ut_release_mutex(ACPI_MTX_INTERPRETER);  	if (ACPI_FAILURE(status)) { -		ACPI_ERROR((AE_INFO, "Could not release interpreter mutex")); +		ACPI_ERROR((AE_INFO, +			    "Could not release AML Interpreter mutex")); +	} + +	return_VOID; +} + +/******************************************************************************* + * + * FUNCTION:    acpi_ex_relinquish_interpreter + * + * PARAMETERS:  None + * + * RETURN:      None + * + * DESCRIPTION: Exit the interpreter execution region, from within the + *              interpreter - before attempting an operation that will possibly + *              block the running thread. + * + * Cases where the interpreter is unlocked internally + *      1) Method to be blocked on a Sleep() AML opcode + *      2) Method to be blocked on an Acquire() AML opcode + *      3) Method to be blocked on a Wait() AML opcode + *      4) Method to be blocked to acquire the global lock + *      5) Method to be blocked waiting to execute a serialized control method + *          that is currently executing + *      6) About to invoke a user-installed opregion handler + * + ******************************************************************************/ + +void acpi_ex_relinquish_interpreter(void) +{ +	ACPI_FUNCTION_TRACE(ex_relinquish_interpreter); + +	/* +	 * If the global serialized flag is set, do not release the interpreter. +	 * This forces the interpreter to be single threaded. +	 */ +	if (!acpi_gbl_all_methods_serialized) { +		acpi_ex_exit_interpreter();  	}  	return_VOID; @@ -141,8 +205,8 @@ void acpi_ex_exit_interpreter(void)   *   * RETURN:      none   * - * DESCRIPTION: Truncate a number to 32-bits if the currently executing method - *              belongs to a 32-bit ACPI table. + * DESCRIPTION: Truncate an ACPI Integer to 32 bits if the execution mode is + *              32-bit, as determined by the revision of the DSDT.   *   ******************************************************************************/  | 
