summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2014-07-08 04:06:45 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-07-08 14:22:25 +0200
commit83b80bace4bdfc61abd16ca6ad0a51734a0f57f0 (patch)
treed358faaa07e08a90d88d84238ecd5594fcc125b3 /drivers/acpi
parentACPICA: Utilities: Cleanup DEFINE_ACPI_GLOBALS by moving acpi_ut_init_global(... (diff)
downloadlinux-83b80bace4bdfc61abd16ca6ad0a51734a0f57f0.tar.xz
linux-83b80bace4bdfc61abd16ca6ad0a51734a0f57f0.zip
ACPICA: OSL: Clean up acpi_os_printf()/acpi_os_vprintf() stubs
This patch is mainly for acpidump where there are redundant acpi_os_printf()/acpi_os_vprintf() stubs implemented. This patch cleans up such specific implementation by linking acpidump to osunixxf.c/oswinxf.c. To make acpi_os_printf() exported by osunixxf.c/oswinxf.c to behave as the old acpidump specific ones, applications need to: 1. Initialize acpi_gbl_db_output_flags to ACPI_DB_CONSOLE_OUTPUT. This is automatically done by ACPI_INIT_GLOBAL(), applications need to link utglobal.o to utilize this mechanism. 2. Initialize acpi_gbl_output_file to stdout. For GCC, assigning stdout to acpi_gbl_output_file using ACPI_INIT_GLOBAL() is not possible as stdout is not a constant in GCC environment. As an alternative solution, stdout assignment is put into acpi_os_initialize(). Thus acpi_os_initialize() need to be invoked very early by the applications to initialize the default output of acpi_os_printf(). This patch also releases osunixxf.c to the Linux kernel. Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpica/acglobal.h3
-rw-r--r--drivers/acpi/acpica/acutils.h1
-rw-r--r--drivers/acpi/acpica/utinit.c1
3 files changed, 2 insertions, 3 deletions
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 115eedcade1e..78cc366ca878 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -297,7 +297,7 @@ ACPI_GLOBAL(u32, acpi_gbl_trace_dbg_layer);
*
****************************************************************************/
-ACPI_GLOBAL(u8, acpi_gbl_db_output_flags);
+ACPI_INIT_GLOBAL(u8, acpi_gbl_db_output_flags, ACPI_DB_CONSOLE_OUTPUT);
#ifdef ACPI_DISASSEMBLER
@@ -362,6 +362,7 @@ ACPI_GLOBAL(u32, acpi_gbl_num_objects);
#ifdef ACPI_APPLICATION
ACPI_INIT_GLOBAL(ACPI_FILE, acpi_gbl_debug_file, NULL);
+ACPI_INIT_GLOBAL(ACPI_FILE, acpi_gbl_output_file, NULL);
#endif /* ACPI_APPLICATION */
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index 8a4414869566..e0adbc1f52ed 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -95,7 +95,6 @@ extern const char *acpi_gbl_pt_decode[];
#ifdef ACPI_ASL_COMPILER
#include <stdio.h>
-extern FILE *acpi_gbl_output_file;
#define ACPI_MSG_REDIRECT_BEGIN \
FILE *output_file = acpi_gbl_output_file; \
diff --git a/drivers/acpi/acpica/utinit.c b/drivers/acpi/acpica/utinit.c
index a7936623998f..77120ec9ea86 100644
--- a/drivers/acpi/acpica/utinit.c
+++ b/drivers/acpi/acpica/utinit.c
@@ -207,7 +207,6 @@ acpi_status acpi_ut_init_globals(void)
acpi_gbl_trace_dbg_level = 0;
acpi_gbl_trace_dbg_layer = 0;
acpi_gbl_debugger_configuration = DEBUGGER_THREADING;
- acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT;
acpi_gbl_osi_mutex = NULL;
acpi_gbl_reg_methods_executed = FALSE;