diff options
author | Lv Zheng <lv.zheng@intel.com> | 2015-12-03 10:43:00 +0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-12-15 00:17:44 +0100 |
commit | 8cfb0cdf07e2c260c4d1a102bfec35183907834f (patch) | |
tree | ddc430d68c4cbed66c9cd008812b8885a55cd13d /include | |
parent | 8a2a2501a893bfce65af7098a1b0a61f14f95626 (diff) | |
download | linux-8cfb0cdf07e2c260c4d1a102bfec35183907834f.tar.bz2 |
ACPI / debugger: Add IO interface to access debugger functionalities
This patch adds /sys/kernel/debug/acpi/acpidbg, which can be used by
userspace programs to access ACPICA debugger functionalities.
Known issue:
1. IO flush support
acpi_os_notify_command_complete() and acpi_os_wait_command_ready() can
be used by acpi_dbg module to implement .flush() filesystem operation.
While this patch doesn't go that far. It then becomes userspace tool's
duty now to flush old commands before executing new batch mode commands.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/acpi/platform/aclinux.h | 2 | ||||
-rw-r--r-- | include/acpi/platform/aclinuxex.h | 10 | ||||
-rw-r--r-- | include/linux/acpi_dbg.h | 52 |
3 files changed, 52 insertions, 12 deletions
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 69dbae61ab49..e21857d2ec05 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -152,8 +152,6 @@ #define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_writable #define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_initialize_command_signals #define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_terminate_command_signals -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_wait_command_ready -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_notify_command_complete /* * OSL interfaces used by utilities diff --git a/include/acpi/platform/aclinuxex.h b/include/acpi/platform/aclinuxex.h index 673fdf4663fd..ceea026b2c0b 100644 --- a/include/acpi/platform/aclinuxex.h +++ b/include/acpi/platform/aclinuxex.h @@ -138,16 +138,6 @@ static inline void acpi_os_terminate_command_signals(void) { } -static inline acpi_status acpi_os_wait_command_ready(void) -{ - return AE_ERROR; -} - -static inline acpi_status acpi_os_notify_command_complete(void) -{ - return AE_ERROR; -} - /* * OSL interfaces added by Linux */ diff --git a/include/linux/acpi_dbg.h b/include/linux/acpi_dbg.h new file mode 100644 index 000000000000..60f3887ed816 --- /dev/null +++ b/include/linux/acpi_dbg.h @@ -0,0 +1,52 @@ +/* + * ACPI AML interfacing support + * + * Copyright (C) 2015, Intel Corporation + * Authors: Lv Zheng <lv.zheng@intel.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef _LINUX_ACPI_DBG_H +#define _LINUX_ACPI_DBG_H + +#include <linux/acpi.h> + +#ifdef CONFIG_ACPI_DEBUGGER +int __init acpi_aml_init(void); +int acpi_aml_create_thread(acpi_osd_exec_callback function, void *context); +ssize_t acpi_aml_write_log(const char *msg); +ssize_t acpi_aml_read_cmd(char *buffer, size_t buffer_length); +int acpi_aml_wait_command_ready(void); +int acpi_aml_notify_command_complete(void); +#else +static int inline acpi_aml_init(void) +{ + return 0; +} +static inline int acpi_aml_create_thread(acpi_osd_exec_callback function, + void *context) +{ + return -ENODEV; +} +static inline int acpi_aml_write_log(const char *msg) +{ + return -ENODEV; +} +static inline int acpi_aml_read_cmd(char *buffer, u32 buffer_length) +{ + return -ENODEV; +} +static inline int acpi_aml_wait_command_ready(void) +{ + return -ENODEV; +} +static inline int acpi_aml_notify_command_complete(void) +{ + return -ENODEV; +} +#endif + +#endif /* _LINUX_ACPI_DBG_H */ |