aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2014-07-07 22:07:06 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-07-08 08:22:26 -0400
commit2e70da4c51eb18a4d229aa48763c15f5dbc5b43d (patch)
tree27bbb3864f794852a673f016f4e5be60720f331e /include/acpi
parent80a648c12e4bda45c4f1bb93d83184fb3010ac12 (diff)
ACPICA: Utilities: Introduce acpi_log_error() to improve portability
Invocations like fprintf(stderr) and perror() are not portable, this patch introduces acpi_log_error() as a replacement, it is implemented using new portable API - acpi_ut_file_vprintf(). Note that though acpi_os_initialize() need to be invoked prior than using this new API, since no users are introduced in this patch, such invocations are not added for applications that link utprint.c in this patch. Futher patches that introduce users of acpi_log_error() should take care of this. This patch is only useful for ACPICA applications, most of which are not shipped in the Linux kernel. Note that follow-up commits will update acpidump to use this new API to improve portability. 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 'include/acpi')
-rw-r--r--include/acpi/acpixf.h20
-rw-r--r--include/acpi/platform/acenv.h4
2 files changed, 24 insertions, 0 deletions
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 35b525c19711..9858551fc84a 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -335,6 +335,23 @@ ACPI_GLOBAL(u8, acpi_gbl_system_awake_and_running);
335 335
336#endif /* ACPI_DEBUG_OUTPUT */ 336#endif /* ACPI_DEBUG_OUTPUT */
337 337
338/*
339 * Application prototypes
340 *
341 * All interfaces used by application will be configured
342 * out of the ACPICA build unless the ACPI_APPLICATION
343 * flag is defined.
344 */
345#ifdef ACPI_APPLICATION
346#define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \
347 prototype;
348
349#else
350#define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \
351 static ACPI_INLINE prototype {return;}
352
353#endif /* ACPI_APPLICATION */
354
338/***************************************************************************** 355/*****************************************************************************
339 * 356 *
340 * ACPICA public interface prototypes 357 * ACPICA public interface prototypes
@@ -861,6 +878,9 @@ ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
861 const char *module_name, 878 const char *module_name,
862 u32 component_id, 879 u32 component_id,
863 const char *format, ...)) 880 const char *format, ...))
881ACPI_APP_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1)
882 void ACPI_INTERNAL_VAR_XFACE
883 acpi_log_error(const char *format, ...))
864 884
865/* 885/*
866 * Divergences 886 * Divergences
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index b6429e46847a..4390ebd99fda 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -423,8 +423,12 @@ typedef char *va_list;
423#ifdef ACPI_APPLICATION 423#ifdef ACPI_APPLICATION
424#include <stdio.h> 424#include <stdio.h>
425#define ACPI_FILE FILE * 425#define ACPI_FILE FILE *
426#define ACPI_FILE_OUT stdout
427#define ACPI_FILE_ERR stderr
426#else 428#else
427#define ACPI_FILE void * 429#define ACPI_FILE void *
430#define ACPI_FILE_OUT NULL
431#define ACPI_FILE_ERR NULL
428#endif /* ACPI_APPLICATION */ 432#endif /* ACPI_APPLICATION */
429#endif /* ACPI_FILE */ 433#endif /* ACPI_FILE */
430 434