ACPICA: Clib/EFI: Fix wrong order of standard integer types/IO handles
authorLv Zheng <lv.zheng@intel.com>
Thu, 4 Aug 2016 08:44:52 +0000 (16:44 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 13 Aug 2016 01:09:35 +0000 (03:09 +0200)
ACPICA commit 7f9b359b7c78c69b07f62eb2d58f710c351fd75d

EFI header should use standard C library stuffs (integer types and IO
handles) rather than implementing such standard stuffs.
This patch fixes this issue by:
1. Implementing standard integer types for ACPI_USE_STANDARD_HADERS=n;
2. Defining EFI types using standard integer types and standard IO handles;
3. Tuning header inclusion order and environment definition order;
4. Removing wrong standard header inclusion from ACPICA core files;
5. Moving several application headers from acpidump.h to acenv.h.
This patch corrects some of them. Lv Zheng.

Except some harmless header inclusion re-ordering, Linux kernel is not
affected by this change.

Link: https://github.com/acpica/acpica/commit/7f9b359b
Link: https://bugs.acpica.org/show_bug.cgi?id=1300
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>
drivers/acpi/acpica/acapps.h
drivers/acpi/acpica/utpredef.c
include/acpi/platform/acenv.h
include/acpi/platform/acenvex.h
tools/power/acpi/common/cmfsize.c
tools/power/acpi/tools/acpidump/acpidump.h

index ca2c0607104bd59a223f4197a40bdc507ff766a7..247f30c33e21c4f46c77690db9841d617feebc94 100644 (file)
@@ -44,8 +44,6 @@
 #ifndef _ACAPPS
 #define _ACAPPS
 
-#include <stdio.h>
-
 /* Common info for tool signons */
 
 #define ACPICA_NAME                 "Intel ACPI Component Architecture"
index 770a1775b264f8e0efa410fa7d5296a2fcb036b4..ce18346b614427124e63ecc23fadd0522dd13cb2 100644 (file)
@@ -176,8 +176,6 @@ void acpi_ut_get_expected_return_types(char *buffer, u32 expected_btypes)
  ******************************************************************************/
 
 #if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)
-#include <stdio.h>
-#include <string.h>
 
 /* Local prototypes */
 
index ee5c0b98e53a052b1d1f62806c3de8cf462f2e76..1e2fe9501c1619999da5030734624a3c63d58e56 100644 (file)
 #elif defined(__OS2__)
 #include "acos2.h"
 
-#elif defined(_AED_EFI)
-#include "acefi.h"
-
-#elif defined(_GNU_EFI)
-#include "acefi.h"
-
 #elif defined(__HAIKU__)
 #include "achaiku.h"
 
 #elif defined(__QNX__)
 #include "acqnx.h"
 
+/*
+ * EFI applications can be built with -nostdlib, in this case, it must be
+ * included after including all other host environmental definitions, in
+ * order to override the definitions.
+ */
+#elif defined(_AED_EFI) || defined(_GNU_EFI)
+#include "acefi.h"
+
 #else
 
 /* Unknown environment */
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#ifdef ACPI_APPLICATION
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/stat.h>
+#endif
 
 #endif                         /* ACPI_USE_STANDARD_HEADERS */
 
-#ifndef ACPI_FILE
 #ifdef ACPI_APPLICATION
-#include <stdio.h>
 #define ACPI_FILE              FILE *
 #define ACPI_FILE_OUT          stdout
 #define ACPI_FILE_ERR          stderr
 #define ACPI_FILE_OUT          NULL
 #define ACPI_FILE_ERR          NULL
 #endif                         /* ACPI_APPLICATION */
-#endif                         /* ACPI_FILE */
 
 #ifndef ACPI_INIT_FUNCTION
 #define ACPI_INIT_FUNCTION
index 4f15c1d10b613a0f5bcf09579c596e221d8c63ea..b6726152a3000ff84c2e7aaa4d28d968f08d7d3c 100644 (file)
 #elif defined(WIN32)
 #include "acwinex.h"
 
-#elif defined(_AED_EFI)
-#include "acefiex.h"
-
-#elif defined(_GNU_EFI)
-#include "acefiex.h"
-
 #elif defined(__DragonFly__)
 #include "acdragonflyex.h"
 
+/*
+ * EFI applications can be built with -nostdlib, in this case, it must be
+ * included after including all other host environmental definitions, in
+ * order to override the definitions.
+ */
+#elif defined(_AED_EFI) || defined(_GNU_EFI)
+#include "acefiex.h"
+
 #endif
 
 /*! [End] no source code translation !*/
index e73a79fce0150688b2736917f030a9dd7a026a07..d2240e60566f54ba5966894701e19a1a282ef33d 100644 (file)
@@ -44,7 +44,6 @@
 #include <acpi/acpi.h>
 #include "accommon.h"
 #include "acapps.h"
-#include <stdio.h>
 
 #define _COMPONENT          ACPI_TOOLS
 ACPI_MODULE_NAME("cmfsize")
index 94dd8a10f7f6e798852f30ff158c71608dea5d03..9f7db006f326546a5a9f2eaef72d4199f43cd1a8 100644 (file)
 #include "accommon.h"
 #include "actables.h"
 
-#include <stdio.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/stat.h>
-
 /* Globals */
 
 EXTERN u8 INIT_GLOBAL(gbl_summary_mode, FALSE);
This page took 0.028368 seconds and 5 git commands to generate.