summaryrefslogtreecommitdiff
path: root/source/tools/acpixtract
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2014-06-12 15:16:19 +0800
committerLv Zheng <lv.zheng@intel.com>2014-06-12 15:16:19 +0800
commit630622cedf3e4b0a03afebe1316243a9111f54ca (patch)
treeed2472989d0a4867fd25173c781f08beec726c5b /source/tools/acpixtract
parent5bf3cb862f67d59e30ccdfc2abf37def86ab466d (diff)
downloadacpica-630622cedf3e4b0a03afebe1316243a9111f54ca.tar.gz
Application: Enhance ACPI_USAGE_xxx/ACPI_OPTION with AcpiOsPrintf() to improve portability.
This patch enhances ACPI_USAGE_xxx/ACPI_OPTION macros to use portable AcpiOsPrintf() so that usage functions for applications no longer rely on the printf() API. To use AcpiOsPrintf() exported by osunixxf.c/oswinxf.c as a replacement of printf, applications need to initialize AcpiGbl_OutputFile to stdout and initialize AcpiGbl_DbOutputFlags to ACPI_DB_CONSOLE_OUTPUT. The latter is automatically done by ACPI_INIT_GLOBAL(), applications need to link utglobal.o to utilize this mechanism. For GCC, assigning stdout to AcpiGbl_OutputFile using ACPI_INIT_GLOBAL() is not possible as stdout is not a constant in GCC environment. As an alternative solution, stdout assignment has been put into AcpiOsInitialize(). Thus AcpiOsInitialize() need to be invoked very early by the applications to initialize the default output of AcpiOsPrintf() to keep behavior consistency. The details of AcpiOsInitialize() are as follows: 1. acpidump have already invoked AcpiOsInitialize(), thus no need to add. 2. acpiexamples/acpiexec/acpinames have already invoked AcpiInitializeSubsystem() very early, thus no need to add AcpiOsInitialize() for them. 3. iasl have already invoked AcpiOsInitialize(), but the invocation is not early enough to make its usage functioning proper. This patch adds an early AcpiOsInitialize() invocation for it. Unix makefiles are also updated to include osunixxf.o/utglobal.o in this patch. The acpihelp/acpisrc/acpixtract applications are the only ones that do not have the 2 object files linked. Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Diffstat (limited to 'source/tools/acpixtract')
-rw-r--r--source/tools/acpixtract/axmain.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/tools/acpixtract/axmain.c b/source/tools/acpixtract/axmain.c
index f9d4fae43..73b575c7a 100644
--- a/source/tools/acpixtract/axmain.c
+++ b/source/tools/acpixtract/axmain.c
@@ -170,8 +170,8 @@ DisplayUsage (
ACPI_OPTION ("-s <signature>", "Extract all tables with <signature>");
ACPI_OPTION ("-v", "Display version information");
- printf ("\nExtract binary ACPI tables from text acpidump output\n");
- printf ("Default invocation extracts the DSDT and all SSDTs\n");
+ ACPI_USAGE_TEXT ("\nExtract binary ACPI tables from text acpidump output\n");
+ ACPI_USAGE_TEXT ("Default invocation extracts the DSDT and all SSDTs\n");
}
@@ -194,6 +194,7 @@ main (
ACPI_DEBUG_INITIALIZE (); /* For debug version only */
+ AcpiOsInitialize ();
printf (ACPI_COMMON_SIGNON (AX_UTILITY_NAME));
if (argc < 2)