Skip to content

Commit

Permalink
ACPICA: Clib/EFI: Fix wrong order of standard integer types/IO handles
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lv Zheng authored and Rafael J. Wysocki committed Aug 13, 2016
1 parent da24f31 commit 4e2fc6a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 25 deletions.
2 changes: 0 additions & 2 deletions drivers/acpi/acpica/acapps.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
#ifndef _ACAPPS
#define _ACAPPS

#include <stdio.h>

/* Common info for tool signons */

#define ACPICA_NAME "Intel ACPI Component Architecture"
Expand Down
2 changes: 0 additions & 2 deletions drivers/acpi/acpica/utpredef.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
23 changes: 14 additions & 9 deletions include/acpi/platform/acenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,20 @@
#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 */
Expand Down Expand Up @@ -344,12 +346,16 @@
#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
Expand All @@ -358,7 +364,6 @@
#define ACPI_FILE_OUT NULL
#define ACPI_FILE_ERR NULL
#endif /* ACPI_APPLICATION */
#endif /* ACPI_FILE */

#ifndef ACPI_INIT_FUNCTION
#define ACPI_INIT_FUNCTION
Expand Down
14 changes: 8 additions & 6 deletions include/acpi/platform/acenvex.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@
#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 !*/
Expand Down
1 change: 0 additions & 1 deletion tools/power/acpi/common/cmfsize.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 0 additions & 5 deletions tools/power/acpi/tools/acpidump/acpidump.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@
#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);
Expand Down

0 comments on commit 4e2fc6a

Please sign in to comment.