diff options
author | Lv Zheng <lv.zheng@intel.com> | 2015-10-19 10:25:50 +0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-10-22 02:05:05 +0200 |
commit | f988f24ee7931d3487b36cc0c29164296bf2191e (patch) | |
tree | 9b4ed3372e6f85a5620e958ef3d05df9ca37c190 /include/acpi/acpiosxf.h | |
parent | 086ab742ac97b45ee64507b32b3d1ecbdbc56b39 (diff) | |
download | talos-op-linux-f988f24ee7931d3487b36cc0c29164296bf2191e.tar.gz talos-op-linux-f988f24ee7931d3487b36cc0c29164296bf2191e.zip |
ACPICA: Debugger: Add thread ID support so that single step mode can only apply to the debugger thread
When the debugger is running in the kernel mode, acpi_db_single_step() may
also be invoked by the kernel runtime code path but the single stepping
command prompt may be erronously logged as the kernel logs and runtime code
path cannot proceed.
This patch fixes this issue by adding acpi_gbl_db_thread_id for the debugger
thread and preventing acpi_db_single_step() to be invoked from other threads.
It is not suitable to add acpi_thread_id parameter for acpi_os_execute() as
the function may be implemented as work queue on some hosts. So it is
better to let the hosts invoke acpi_set_debugger_thread_id(). Currently
acpiexec is not configured as DEBUGGER_MULTI_THREADED, but we can do this.
When we do this, it is better to invoke acpi_set_debugger_thread_id() in
acpi_os_execute() when the execution type is OSL_DEBUGGER_MAIN_THREAD. The
support should look like:
create_thread(&tid);
if (type == OSL_DEBUGGER_MAIN_THREAD)
acpi_set_debugger_thread_id(tid);
resume_thread(tid);
Similarly, semop() may be used for pthread implementation. But this patch
simply skips debugger thread ID check for application instead of
introducing such complications as there is no need to skip
acpi_db_single_step() for an application debugger - acpiexec.
Note that the debugger thread ID can also be used by acpi_os_printf() to
filter out debugger output. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/acpi/acpiosxf.h')
-rw-r--r-- | include/acpi/acpiosxf.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index a54ad1cc990c..fbc2baf2b9dc 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -55,7 +55,8 @@ typedef enum { OSL_GLOBAL_LOCK_HANDLER, OSL_NOTIFY_HANDLER, OSL_GPE_HANDLER, - OSL_DEBUGGER_THREAD, + OSL_DEBUGGER_MAIN_THREAD, + OSL_DEBUGGER_EXEC_THREAD, OSL_EC_POLL_HANDLER, OSL_EC_BURST_HANDLER } acpi_execute_type; |