diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-01-12 03:09:06 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-01-12 03:09:06 +0300 |
commit | 51834d6ae9ae290482bff1389c304f244c7109ee (patch) | |
tree | 8389f1c2476cbb5cfe9bac4b790d9ba4f2176a05 /include/linux/acpi.h | |
parent | 1e3f28a552c7acf6dd8acfe505beb4990e8cbd55 (diff) | |
parent | 59adb3988ebeec012343317ac783d6a7935e0c83 (diff) | |
download | linux-51834d6ae9ae290482bff1389c304f244c7109ee.tar.xz |
Merge branch 'acpi-debug'
* acpi-debug:
ACPI / debugger: Fix a redundant mutex unlock issue in acpi_aml_open()
ACPI / debugger: copy_to_user doesn't return errors
ACPI / debugger: remove some unneeded conditions
ACPI / debugger: Fix an issue a flag is modified without locking
ACPI / debugger: Add module support for ACPI debugger
tools/power/acpi: Add userspace AML interface support
ACPI / debugger: Add IO interface to access debugger functionalities
ACPICA: Debugger: Fix runtime stub issues of ACPI_DEBUGGER_EXEC using different stub mechanism
ACPICA: Debugger: Convert some mechanisms to OSPM specific
ACPICA: Debugger: Remove unnecessary status check
Diffstat (limited to 'include/linux/acpi.h')
-rw-r--r-- | include/linux/acpi.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 1991aea2ec4c..a03a05474527 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -37,6 +37,8 @@ #include <linux/list.h> #include <linux/mod_devicetable.h> #include <linux/dynamic_debug.h> +#include <linux/module.h> +#include <linux/mutex.h> #include <acpi/acpi_bus.h> #include <acpi/acpi_drivers.h> @@ -119,6 +121,75 @@ typedef int (*acpi_tbl_table_handler)(struct acpi_table_header *table); typedef int (*acpi_tbl_entry_handler)(struct acpi_subtable_header *header, const unsigned long end); +/* Debugger support */ + +struct acpi_debugger_ops { + int (*create_thread)(acpi_osd_exec_callback function, void *context); + ssize_t (*write_log)(const char *msg); + ssize_t (*read_cmd)(char *buffer, size_t length); + int (*wait_command_ready)(bool single_step, char *buffer, size_t length); + int (*notify_command_complete)(void); +}; + +struct acpi_debugger { + const struct acpi_debugger_ops *ops; + struct module *owner; + struct mutex lock; +}; + +#ifdef CONFIG_ACPI_DEBUGGER +int __init acpi_debugger_init(void); +int acpi_register_debugger(struct module *owner, + const struct acpi_debugger_ops *ops); +void acpi_unregister_debugger(const struct acpi_debugger_ops *ops); +int acpi_debugger_create_thread(acpi_osd_exec_callback function, void *context); +ssize_t acpi_debugger_write_log(const char *msg); +ssize_t acpi_debugger_read_cmd(char *buffer, size_t buffer_length); +int acpi_debugger_wait_command_ready(void); +int acpi_debugger_notify_command_complete(void); +#else +static inline int acpi_debugger_init(void) +{ + return -ENODEV; +} + +static inline int acpi_register_debugger(struct module *owner, + const struct acpi_debugger_ops *ops) +{ + return -ENODEV; +} + +static inline void acpi_unregister_debugger(const struct acpi_debugger_ops *ops) +{ +} + +static inline int acpi_debugger_create_thread(acpi_osd_exec_callback function, + void *context) +{ + return -ENODEV; +} + +static inline int acpi_debugger_write_log(const char *msg) +{ + return -ENODEV; +} + +static inline int acpi_debugger_read_cmd(char *buffer, u32 buffer_length) +{ + return -ENODEV; +} + +static inline int acpi_debugger_wait_command_ready(void) +{ + return -ENODEV; +} + +static inline int acpi_debugger_notify_command_complete(void) +{ + return -ENODEV; +} +#endif + #ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE void acpi_initrd_override(void *data, size_t size); #else |