linux/drivers/acpi/acpica
Lv Zheng f8d3148962 ACPICA: Debugger: Convert some mechanisms to OSPM specific
The following mechanisms are OSPM specific:
1. Redirect output destination to console: no file redirection will be
   needed by an in-kernel debugger, there is even no file can be accessed
   when the debugger is running in the kernel mode.
2. Output command prompts: programs other than acpiexec can have different
   prompt characters and the prompt characters may be implemented as a
   special character sequence to form a char device IO protocol.
3. Command ready/complete handshake: OSPM debugger may wait more conditions
   to implement OSPM specific semantics (for example, FIFO full/empty
   conditions for O_NONBLOCK or IO open/close conditions).
Leaving such OSPM specific stuffs in the ACPICA debugger core blocks
Linux debugger IO driver implementation.

Several new OSL APIs are provided by this patch:
1. acpi_os_initialize_command_signals: initialize command handshake mechanism
   or any other OSPM specific stuffs.
2. acpi_os_terminate_command_signals: reversal of
   acpi_os_initialize_command_signals.
3. acpi_os_wait_command_ready: putting debugger task into wait state when a
   command is not ready. OSPMs can terminate command loop by returning
   AE_CTRL_TERMINATE from this API. Normally, wait_event() or
   wait_for_multiple_object() may be used to implement this API.
4. acpi_os_notify_command_complete: putting user task into running state when a
   command has been completed. OSPMs can terminate command loop by
   returning AE_CTRL_TERMINATE from this API. Normally, wake_up() or
   set_event() may be used to implement this API.
This patch also converts current command signaling implementation into a
generic debugger layer (osgendbg.c) to be used by the existing OSPMs or
acpiexec, in return, Linux can have chance to implement its own command
handshake mechanism. This patch also implements acpiexec batch mode in a
multi-threading mode comaptible style as a demo (this can be confirmed by
configuring acpiexec into DEBUGGER_MULTI_THREADED mode where the batch mode
is still working). Lv Zheng.

Note that the OSPM specific command handshake mechanism is required by
Linux kernel because:
1. Linux kernel trends to use wait queue to synchronize two threads, using
   mutexes to achieve that will cause false "dead lock" warnings.
2. The command handshake mechanism implemented by ACPICA is implemented in
   this way because of a design issue in debugger IO streaming. Debugger IO
   outputs are simply cached using a giant buffer, this should be tuned by
   Linux in the future.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-12-15 00:17:43 +01:00
..
acapps.h ACPICA: iASL: General cleanup of the file suffix #defines 2015-10-22 02:01:12 +02:00
accommon.h ACPICA: Split C library prototypes to new header 2015-07-01 23:17:56 +02:00
acdebug.h ACPICA: Debugger: Convert some mechanisms to OSPM specific 2015-12-15 00:17:43 +01:00
acdispat.h ACPICA: Dispatcher: Move stack traversal code to dispatcher 2015-07-23 23:09:06 +02:00
acevents.h ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
acglobal.h ACPICA: Debugger: Convert some mechanisms to OSPM specific 2015-12-15 00:17:43 +01:00
achware.h ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
acinterp.h ACPI: Enable build of AML interpreter debugger 2015-10-22 02:05:05 +02:00
aclocal.h ACPICA: Debugger: Add thread ID support so that single step mode can only apply to the debugger thread 2015-10-22 02:05:05 +02:00
acmacros.h ACPICA: Cleanup use of NEGATIVE and POSITIVE defines 2015-07-23 23:09:08 +02:00
acnamesp.h ACPI: Enable build of AML interpreter debugger 2015-10-22 02:05:05 +02:00
acobject.h ACPICA: Executer: Add back pointing reference of method operand 2015-07-23 23:09:06 +02:00
acopcode.h ACPICA: Improve typechecking, both compile-time and runtime 2015-10-22 02:01:12 +02:00
acparser.h ACPI: Enable build of AML interpreter debugger 2015-10-22 02:05:05 +02:00
acpredef.h ACPICA: ACPI 6.0: Add support for new predefined names. 2015-05-22 03:22:19 +02:00
acresrc.h ACPICA: Update Resource descriptor dump module. 2015-04-14 14:51:53 +02:00
acstruct.h ACPICA: Parser: Cleanup aml_offset in struct acpi_walk_state 2015-07-23 23:09:06 +02:00
actables.h ACPICA: Tables: Fix FADT dependency regression 2015-10-14 22:48:13 +02:00
acutils.h ACPI: Enable build of AML interpreter debugger 2015-10-22 02:05:05 +02:00
amlcode.h ACPICA: Improve typechecking, both compile-time and runtime 2015-10-22 02:01:12 +02:00
amlresrc.h ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
dbcmds.c ACPICA: Linuxize: Export debugger files to Linux 2015-10-22 02:04:28 +02:00
dbconvert.c ACPICA: Linuxize: Export debugger files to Linux 2015-10-22 02:04:28 +02:00
dbdisply.c ACPICA: Linuxize: Export debugger files to Linux 2015-10-22 02:04:28 +02:00
dbexec.c ACPICA: Debugger: Fix dead lock issue ocurred in single stepping mode 2015-10-22 02:05:06 +02:00
dbfileio.c ACPICA: Linuxize: Export debugger files to Linux 2015-10-22 02:04:28 +02:00
dbhistry.c ACPICA: Linuxize: Export debugger files to Linux 2015-10-22 02:04:28 +02:00
dbinput.c ACPICA: Debugger: Convert some mechanisms to OSPM specific 2015-12-15 00:17:43 +01:00
dbmethod.c ACPICA: Linuxize: Export debugger files to Linux 2015-10-22 02:04:28 +02:00
dbnames.c ACPICA: Linuxize: Export debugger files to Linux 2015-10-22 02:04:28 +02:00
dbobject.c ACPICA: Linuxize: Export debugger files to Linux 2015-10-22 02:04:28 +02:00
dbstats.c ACPICA: Linuxize: Export debugger files to Linux 2015-10-22 02:04:28 +02:00
dbtest.c ACPICA: Linuxize: Export debugger files to Linux 2015-10-22 02:04:28 +02:00
dbutils.c ACPICA: Linuxize: Export debugger files to Linux 2015-10-22 02:04:28 +02:00
dbxface.c ACPICA: Debugger: Convert some mechanisms to OSPM specific 2015-12-15 00:17:43 +01:00
dsargs.c ACPICA: Dispatcher: Cleanup union acpi_operand_object's AML address assignments 2015-07-23 23:09:06 +02:00
dscontrol.c ACPICA: Make the max-number-of-loops runtime configurable 2015-08-25 23:11:32 +02:00
dsdebug.c ACPICA: Debugger: Cleanup debugging outputs to dump name path without trailing underscores 2015-08-25 23:11:33 +02:00
dsfield.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
dsinit.c ACPICA: Table handling: Cleanup and update debug output for tools 2015-08-25 23:11:32 +02:00
dsmethod.c ACPICA: Debugger: Move debugger specific APIs to debugger component 2015-07-23 23:09:08 +02:00
dsmthdat.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
dsobject.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
dsopcode.c ACPICA: Update parameter validation for data_table_region and load_table 2015-08-25 23:11:31 +02:00
dsutils.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
dswexec.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
dswload2.c ACPICA: Dispatcher: Cleanup union acpi_operand_object's AML address assignments 2015-07-23 23:09:06 +02:00
dswload.c ACPICA: Dispatcher: Cleanup union acpi_operand_object's AML address assignments 2015-07-23 23:09:06 +02:00
dswscope.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
dswstate.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
evevent.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
evglock.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
evgpe.c ACPICA: Store GPE register enable masks upfront 2015-04-15 04:00:27 +02:00
evgpeblk.c ACPICA: Events: Introduce ACPI_GPE_DISPATCH_RAW_HANDLER to fix 2 issues for the current GPE APIs 2015-02-05 15:34:51 +01:00
evgpeinit.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
evgpeutil.c ACPICA: Events: Introduce ACPI_GPE_DISPATCH_RAW_HANDLER to fix 2 issues for the current GPE APIs 2015-02-05 15:34:51 +01:00
evhandler.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
evmisc.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
evregion.c ACPICA: Add additional debug info/statements 2015-08-25 23:11:32 +02:00
evrgnini.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
evsci.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
evxface.c ACPI: Enable build of AML interpreter debugger 2015-10-22 02:05:05 +02:00
evxfevnt.c ACPICA: Tables: Fix FADT dependency regression 2015-10-14 22:48:13 +02:00
evxfgpe.c ACPICA: Events: Enable APIs to allow interrupt/polling adaptive request based GPE handling model 2015-02-05 15:34:51 +01:00
evxfregn.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
exconfig.c ACPICA: Update parameter validation for data_table_region and load_table 2015-08-25 23:11:31 +02:00
exconvrt.c ACPICA: Improve typechecking, both compile-time and runtime 2015-10-22 02:01:12 +02:00
excreate.c ACPICA: Executer: Add back pointing reference of method operand 2015-07-23 23:09:06 +02:00
exdebug.c ACPICA: Executer: Add option to bypass opcode tracing 2015-07-23 23:09:07 +02:00
exdump.c ACPICA: Debugger: Cleanup debugging outputs to dump name path without trailing underscores 2015-08-25 23:11:33 +02:00
exfield.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
exfldio.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
exmisc.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
exmutex.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
exnames.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
exoparg1.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
exoparg2.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
exoparg3.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
exoparg6.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
exprep.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
exregion.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
exresnte.c ACPICA: Correctly cleanup after a ACPI table load failure 2015-08-25 23:11:30 +02:00
exresolv.c ACPICA: Improve typechecking, both compile-time and runtime 2015-10-22 02:01:12 +02:00
exresop.c ACPICA: Improve typechecking, both compile-time and runtime 2015-10-22 02:01:12 +02:00
exstore.c ACPICA: Improve typechecking, both compile-time and runtime 2015-10-22 02:01:12 +02:00
exstoren.c ACPICA: Improve typechecking, both compile-time and runtime 2015-10-22 02:01:12 +02:00
exstorob.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
exsystem.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
exutils.c ACPICA: Utilities: Add _CLS processing 2015-07-01 23:17:53 +02:00
hwacpi.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
hwesleep.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
hwgpe.c ACPICA: Store GPE register enable masks upfront 2015-04-15 04:00:27 +02:00
hwpci.c ACPICA: Hardware: Fix a resource leak issue in acpi_hw_build_pci_list(). 2015-05-22 03:22:20 +02:00
hwregs.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
hwsleep.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
hwtimer.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
hwvalid.c ACPICA: Utilities: Cleanup to convert physical address printing formats. 2015-04-14 14:51:51 +02:00
hwxface.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
hwxfsleep.c ACPICA: Tables: Cleanup to reduce FACS globals 2015-08-25 23:11:31 +02:00
Makefile ACPI: Enable build of AML interpreter debugger 2015-10-22 02:05:05 +02:00
nsaccess.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
nsalloc.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
nsarguments.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
nsconvert.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
nsdump.c ACPI: Enable build of AML interpreter debugger 2015-10-22 02:05:05 +02:00
nsdumpdv.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
nseval.c ACPICA: Add additional debug info/statements 2015-08-25 23:11:32 +02:00
nsinit.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
nsload.c ACPICA: Correctly cleanup after a ACPI table load failure 2015-08-25 23:11:30 +02:00
nsnames.c ACPICA: Namespace: Add function to directly return normalized full path 2015-07-23 23:09:06 +02:00
nsobject.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
nsparse.c ACPICA: Dispatcher: Cleanup union acpi_operand_object's AML address assignments 2015-07-23 23:09:06 +02:00
nspredef.c ACPICA: Improve typechecking, both compile-time and runtime 2015-10-22 02:01:12 +02:00
nsprepkg.c ACPICA: ACPI 6.0: Add support for new predefined names. 2015-05-22 03:22:19 +02:00
nsrepair2.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
nsrepair.c ACPICA: ACPI 6.0: Add support for new predefined names. 2015-05-22 03:22:19 +02:00
nssearch.c ACPICA: Namespace: Change namespace override to avoid node deletion 2015-07-01 23:17:54 +02:00
nsutils.c ACPICA: Debugger: Cleanup debugging outputs to dump name path without trailing underscores 2015-08-25 23:11:33 +02:00
nswalk.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
nsxfeval.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
nsxfname.c ACPICA: Namespace: Add function to directly return normalized full path 2015-07-23 23:09:06 +02:00
nsxfobj.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
psargs.c ACPICA: Dispatcher: Cleanup union acpi_operand_object's AML address assignments 2015-07-23 23:09:06 +02:00
psloop.c ACPICA: Add additional debug info/statements 2015-08-25 23:11:32 +02:00
psobject.c ACPICA: Dispatcher: Cleanup union acpi_operand_object's AML address assignments 2015-07-23 23:09:06 +02:00
psopcode.c ACPICA: Add infrastructure for External() opcode. 2015-04-14 14:51:54 +02:00
psopinfo.c ACPICA: Parser: Move a couple externals to the proper header. 2015-05-22 03:22:19 +02:00
psparse.c ACPICA: Executer: Add interpreter tracing mode for method tracing facility 2015-07-23 23:09:07 +02:00
psscope.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
pstree.c ACPI: Enable build of AML interpreter debugger 2015-10-22 02:05:05 +02:00
psutils.c ACPI: Enable build of AML interpreter debugger 2015-10-22 02:05:05 +02:00
pswalk.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
psxface.c ACPICA: Executer: Add interpreter tracing mode for method tracing facility 2015-07-23 23:09:07 +02:00
rsaddr.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
rscalc.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
rscreate.c ACPICA: Namespace: Add function to directly return normalized full path 2015-07-23 23:09:06 +02:00
rsdump.c ACPICA: Remove unnecessary conditional compilation 2015-10-22 02:01:11 +02:00
rsdumpinfo.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
rsinfo.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
rsio.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
rsirq.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
rslist.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
rsmemory.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
rsmisc.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
rsserial.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
rsutils.c ACPI: Enable build of AML interpreter debugger 2015-10-22 02:05:05 +02:00
rsxface.c ACPI: Enable build of AML interpreter debugger 2015-10-22 02:05:05 +02:00
tbdata.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
tbfadt.c ACPICA: Tables: Fix FADT dependency regression 2015-10-14 22:48:13 +02:00
tbfind.c ACPICA: Update parameter validation for data_table_region and load_table 2015-08-25 23:11:31 +02:00
tbinstal.c ACPICA: Tables: Fix global table list issues by removing fixed table indexes 2015-08-25 23:11:31 +02:00
tbprint.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
tbutils.c ACPICA: Tables: Fix FADT dependency regression 2015-10-14 22:48:13 +02:00
tbxface.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
tbxfload.c ACPICA: Table handling: Cleanup and update debug output for tools 2015-08-25 23:11:32 +02:00
tbxfroot.c ACPICA: Tables: Change acpi_find_root_pointer() to use acpi_physical_address. 2015-04-14 14:51:50 +02:00
utaddress.c ACPICA: Utilities: Cleanup to convert physical address printing formats. 2015-04-14 14:51:51 +02:00
utalloc.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
utbuffer.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
utcache.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
utcopy.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
utdebug.c ACPICA: Executer: Add OSL trace hook support 2015-07-23 23:09:07 +02:00
utdecode.c ACPICA: Improve typechecking, both compile-time and runtime 2015-10-22 02:01:12 +02:00
utdelete.c ACPICA: Executer: Add back pointing reference of method operand 2015-07-23 23:09:06 +02:00
uterror.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
uteval.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
utexcep.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
utfileio.c ACPICA: Update exception code for "file not found" error 2015-10-22 02:01:12 +02:00
utglobal.c Revert 'Revert "ACPICA: Permanently set _REV to the value '2'."' 2015-07-03 01:06:04 +02:00
uthex.c ACPICA: ACPI 6.0: Add support for NFIT table. 2015-05-22 03:22:21 +02:00
utids.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
utinit.c ACPICA: Debugger: Fix "terminate" command by cleaning up subsystem shutdown logic 2015-10-22 02:05:05 +02:00
utlock.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
utmath.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
utmisc.c ACPICA: Debugger: Cleanup debugging outputs to dump name path without trailing underscores 2015-08-25 23:11:33 +02:00
utmutex.c ACPICA: Debugger: Convert some mechanisms to OSPM specific 2015-12-15 00:17:43 +01:00
utnonansi.c ACPICA: Cleanup use of all non-ANSI local C library functions 2015-07-23 23:09:08 +02:00
utobject.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
utosi.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
utownerid.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
utpredef.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
utprint.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
utresrc.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00
utstate.c ACPICA: Utilities: Remove unused acpi_ut_create_pkg_state_and_push(). 2015-04-14 14:51:52 +02:00
utstring.c ACPICA: Cleanup use of all non-ANSI local C library functions 2015-07-23 23:09:08 +02:00
uttrack.c ACPICA: De-macroize calls to standard C library functions 2015-07-01 23:17:55 +02:00
utuuid.c ACPICA: Utilities: Correct conditional compilation definitions. 2015-04-14 14:51:52 +02:00
utxface.c ACPI: Enable build of AML interpreter debugger 2015-10-22 02:05:05 +02:00
utxferror.c ACPICA: iASL/disassembler - fix possible fault for -e option. 2015-05-22 03:22:21 +02:00
utxfinit.c ACPICA: Debugger: Split debugger initialization/termination APIs 2015-08-25 23:11:33 +02:00
utxfmutex.c ACPICA: Update Copyright headers to 2015 2015-02-05 15:31:43 +01:00