提交 83b80bac 编写于 作者: L Lv Zheng 提交者: Rafael J. Wysocki

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: NLv Zheng <lv.zheng@intel.com>
Signed-off-by: NBob Moore <robert.moore@intel.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 e8c038a3
...@@ -297,7 +297,7 @@ ACPI_GLOBAL(u32, acpi_gbl_trace_dbg_layer); ...@@ -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 #ifdef ACPI_DISASSEMBLER
...@@ -362,6 +362,7 @@ ACPI_GLOBAL(u32, acpi_gbl_num_objects); ...@@ -362,6 +362,7 @@ ACPI_GLOBAL(u32, acpi_gbl_num_objects);
#ifdef ACPI_APPLICATION #ifdef ACPI_APPLICATION
ACPI_INIT_GLOBAL(ACPI_FILE, acpi_gbl_debug_file, NULL); ACPI_INIT_GLOBAL(ACPI_FILE, acpi_gbl_debug_file, NULL);
ACPI_INIT_GLOBAL(ACPI_FILE, acpi_gbl_output_file, NULL);
#endif /* ACPI_APPLICATION */ #endif /* ACPI_APPLICATION */
......
...@@ -95,7 +95,6 @@ extern const char *acpi_gbl_pt_decode[]; ...@@ -95,7 +95,6 @@ extern const char *acpi_gbl_pt_decode[];
#ifdef ACPI_ASL_COMPILER #ifdef ACPI_ASL_COMPILER
#include <stdio.h> #include <stdio.h>
extern FILE *acpi_gbl_output_file;
#define ACPI_MSG_REDIRECT_BEGIN \ #define ACPI_MSG_REDIRECT_BEGIN \
FILE *output_file = acpi_gbl_output_file; \ FILE *output_file = acpi_gbl_output_file; \
......
...@@ -207,7 +207,6 @@ acpi_status acpi_ut_init_globals(void) ...@@ -207,7 +207,6 @@ acpi_status acpi_ut_init_globals(void)
acpi_gbl_trace_dbg_level = 0; acpi_gbl_trace_dbg_level = 0;
acpi_gbl_trace_dbg_layer = 0; acpi_gbl_trace_dbg_layer = 0;
acpi_gbl_debugger_configuration = DEBUGGER_THREADING; acpi_gbl_debugger_configuration = DEBUGGER_THREADING;
acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT;
acpi_gbl_osi_mutex = NULL; acpi_gbl_osi_mutex = NULL;
acpi_gbl_reg_methods_executed = FALSE; acpi_gbl_reg_methods_executed = FALSE;
......
...@@ -108,6 +108,7 @@ DUMP_OBJS = \ ...@@ -108,6 +108,7 @@ DUMP_OBJS = \
apmain.o\ apmain.o\
osunixdir.o\ osunixdir.o\
osunixmap.o\ osunixmap.o\
osunixxf.o\
tbprint.o\ tbprint.o\
tbxfroot.o\ tbxfroot.o\
utbuffer.o\ utbuffer.o\
......
此差异已折叠。
...@@ -427,25 +427,3 @@ int ap_dump_table_from_file(char *pathname) ...@@ -427,25 +427,3 @@ int ap_dump_table_from_file(char *pathname)
free(table); free(table);
return (table_status); return (table_status);
} }
/******************************************************************************
*
* FUNCTION: acpi_os* print functions
*
* DESCRIPTION: Used for linkage with ACPICA modules
*
******************************************************************************/
void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
vfprintf(stdout, fmt, args);
va_end(args);
}
void acpi_os_vprintf(const char *fmt, va_list args)
{
vfprintf(stdout, fmt, args);
}
...@@ -288,6 +288,7 @@ int ACPI_SYSTEM_XFACE main(int argc, char *argv[]) ...@@ -288,6 +288,7 @@ int ACPI_SYSTEM_XFACE main(int argc, char *argv[])
u32 i; u32 i;
ACPI_DEBUG_INITIALIZE(); /* For debug version only */ ACPI_DEBUG_INITIALIZE(); /* For debug version only */
acpi_os_initialize();
/* Process command line options */ /* Process command line options */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册