ACPICA: Re-implement interpreters' "serialized mode"
Enhanced the implementation of the interpreters' serialized mode (boot with "acpi_serialize" to set acpi_glb_all_methods_serialized flag.) When this mode is specified, instead of creating a serialization semaphore per control method, the interpreter lock is simply no longer released before a blocking operation during control method execution. This effectively makes the AML Interpreter single-threaded. The overhead of a semaphore per-method is eliminated. Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:

committad av
Len Brown

förälder
95befdb398
incheckning
1ba753acb3
@@ -291,7 +291,6 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
|
||||
u32 bit_width, acpi_integer * value)
|
||||
{
|
||||
acpi_status status;
|
||||
acpi_status status2;
|
||||
acpi_adr_space_handler handler;
|
||||
acpi_adr_space_setup region_setup;
|
||||
union acpi_operand_object *handler_desc;
|
||||
@@ -345,7 +344,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
|
||||
* setup will potentially execute control methods
|
||||
* (e.g., _REG method for this region)
|
||||
*/
|
||||
acpi_ex_exit_interpreter();
|
||||
acpi_ex_relinquish_interpreter();
|
||||
|
||||
status = region_setup(region_obj, ACPI_REGION_ACTIVATE,
|
||||
handler_desc->address_space.context,
|
||||
@@ -353,10 +352,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
|
||||
|
||||
/* Re-enter the interpreter */
|
||||
|
||||
status2 = acpi_ex_enter_interpreter();
|
||||
if (ACPI_FAILURE(status2)) {
|
||||
return_ACPI_STATUS(status2);
|
||||
}
|
||||
acpi_ex_reacquire_interpreter();
|
||||
|
||||
/* Check for failure of the Region Setup */
|
||||
|
||||
@@ -409,7 +405,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
|
||||
* exit the interpreter because the handler *might* block -- we don't
|
||||
* know what it will do, so we can't hold the lock on the intepreter.
|
||||
*/
|
||||
acpi_ex_exit_interpreter();
|
||||
acpi_ex_relinquish_interpreter();
|
||||
}
|
||||
|
||||
/* Call the handler */
|
||||
@@ -430,10 +426,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
|
||||
* We just returned from a non-default handler, we must re-enter the
|
||||
* interpreter
|
||||
*/
|
||||
status2 = acpi_ex_enter_interpreter();
|
||||
if (ACPI_FAILURE(status2)) {
|
||||
return_ACPI_STATUS(status2);
|
||||
}
|
||||
acpi_ex_reacquire_interpreter();
|
||||
}
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
|
@@ -768,11 +768,9 @@ acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle)
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
status = acpi_ex_enter_interpreter();
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return (status);
|
||||
}
|
||||
/* Must lock interpreter to prevent race conditions */
|
||||
|
||||
acpi_ex_enter_interpreter();
|
||||
status = acpi_ev_acquire_global_lock(timeout);
|
||||
acpi_ex_exit_interpreter();
|
||||
|
||||
|
Referens i nytt ärende
Block a user