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:
@@ -66,7 +66,6 @@ ACPI_MODULE_NAME("exsystem")
|
||||
acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
|
||||
{
|
||||
acpi_status status;
|
||||
acpi_status status2;
|
||||
|
||||
ACPI_FUNCTION_TRACE(ex_system_wait_semaphore);
|
||||
|
||||
@@ -79,7 +78,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
|
||||
|
||||
/* We must wait, so unlock the interpreter */
|
||||
|
||||
acpi_ex_exit_interpreter();
|
||||
acpi_ex_relinquish_interpreter();
|
||||
|
||||
status = acpi_os_wait_semaphore(semaphore, 1, timeout);
|
||||
|
||||
@@ -89,13 +88,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
|
||||
|
||||
/* Reacquire the interpreter */
|
||||
|
||||
status2 = acpi_ex_enter_interpreter();
|
||||
if (ACPI_FAILURE(status2)) {
|
||||
|
||||
/* Report fatal error, could not acquire interpreter */
|
||||
|
||||
return_ACPI_STATUS(status2);
|
||||
}
|
||||
acpi_ex_reacquire_interpreter();
|
||||
}
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
@@ -119,7 +112,6 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
|
||||
acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
|
||||
{
|
||||
acpi_status status;
|
||||
acpi_status status2;
|
||||
|
||||
ACPI_FUNCTION_TRACE(ex_system_wait_mutex);
|
||||
|
||||
@@ -132,7 +124,7 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
|
||||
|
||||
/* We must wait, so unlock the interpreter */
|
||||
|
||||
acpi_ex_exit_interpreter();
|
||||
acpi_ex_relinquish_interpreter();
|
||||
|
||||
status = acpi_os_acquire_mutex(mutex, timeout);
|
||||
|
||||
@@ -142,13 +134,7 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
|
||||
|
||||
/* Reacquire the interpreter */
|
||||
|
||||
status2 = acpi_ex_enter_interpreter();
|
||||
if (ACPI_FAILURE(status2)) {
|
||||
|
||||
/* Report fatal error, could not acquire interpreter */
|
||||
|
||||
return_ACPI_STATUS(status2);
|
||||
}
|
||||
acpi_ex_reacquire_interpreter();
|
||||
}
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
@@ -209,20 +195,18 @@ acpi_status acpi_ex_system_do_stall(u32 how_long)
|
||||
|
||||
acpi_status acpi_ex_system_do_suspend(acpi_integer how_long)
|
||||
{
|
||||
acpi_status status;
|
||||
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
||||
/* Since this thread will sleep, we must release the interpreter */
|
||||
|
||||
acpi_ex_exit_interpreter();
|
||||
acpi_ex_relinquish_interpreter();
|
||||
|
||||
acpi_os_sleep(how_long);
|
||||
|
||||
/* And now we must get the interpreter again */
|
||||
|
||||
status = acpi_ex_enter_interpreter();
|
||||
return (status);
|
||||
acpi_ex_reacquire_interpreter();
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
Reference in New Issue
Block a user