Skip to content

Commit 4e2fc6a

Browse files
Lv Zhengrafaeljw
authored andcommitted
ACPICA: Clib/EFI: Fix wrong order of standard integer types/IO handles
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: open-acpica/acpica@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>
1 parent da24f31 commit 4e2fc6a

6 files changed

Lines changed: 22 additions & 25 deletions

File tree

‎drivers/acpi/acpica/acapps.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444
#ifndef _ACAPPS
4545
#define _ACAPPS
4646

47-
#include <stdio.h>
48-
4947
/* Common info for tool signons */
5048

5149
#define ACPICA_NAME "Intel ACPI Component Architecture"

‎drivers/acpi/acpica/utpredef.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,6 @@ void acpi_ut_get_expected_return_types(char *buffer, u32 expected_btypes)
176176
******************************************************************************/
177177

178178
#if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)
179-
#include <stdio.h>
180-
#include <string.h>
181179

182180
/* Local prototypes */
183181

‎include/acpi/platform/acenv.h‎

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,18 +209,20 @@
209209
#elif defined(__OS2__)
210210
#include "acos2.h"
211211

212-
#elif defined(_AED_EFI)
213-
#include "acefi.h"
214-
215-
#elif defined(_GNU_EFI)
216-
#include "acefi.h"
217-
218212
#elif defined(__HAIKU__)
219213
#include "achaiku.h"
220214

221215
#elif defined(__QNX__)
222216
#include "acqnx.h"
223217

218+
/*
219+
* EFI applications can be built with -nostdlib, in this case, it must be
220+
* included after including all other host environmental definitions, in
221+
* order to override the definitions.
222+
*/
223+
#elif defined(_AED_EFI) || defined(_GNU_EFI)
224+
#include "acefi.h"
225+
224226
#else
225227

226228
/* Unknown environment */
@@ -344,12 +346,16 @@
344346
#include <stdlib.h>
345347
#include <string.h>
346348
#include <ctype.h>
349+
#ifdef ACPI_APPLICATION
350+
#include <stdio.h>
351+
#include <fcntl.h>
352+
#include <errno.h>
353+
#include <sys/stat.h>
354+
#endif
347355

348356
#endif /* ACPI_USE_STANDARD_HEADERS */
349357

350-
#ifndef ACPI_FILE
351358
#ifdef ACPI_APPLICATION
352-
#include <stdio.h>
353359
#define ACPI_FILE FILE *
354360
#define ACPI_FILE_OUT stdout
355361
#define ACPI_FILE_ERR stderr
@@ -358,7 +364,6 @@
358364
#define ACPI_FILE_OUT NULL
359365
#define ACPI_FILE_ERR NULL
360366
#endif /* ACPI_APPLICATION */
361-
#endif /* ACPI_FILE */
362367

363368
#ifndef ACPI_INIT_FUNCTION
364369
#define ACPI_INIT_FUNCTION

‎include/acpi/platform/acenvex.h‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,17 @@
5959
#elif defined(WIN32)
6060
#include "acwinex.h"
6161

62-
#elif defined(_AED_EFI)
63-
#include "acefiex.h"
64-
65-
#elif defined(_GNU_EFI)
66-
#include "acefiex.h"
67-
6862
#elif defined(__DragonFly__)
6963
#include "acdragonflyex.h"
7064

65+
/*
66+
* EFI applications can be built with -nostdlib, in this case, it must be
67+
* included after including all other host environmental definitions, in
68+
* order to override the definitions.
69+
*/
70+
#elif defined(_AED_EFI) || defined(_GNU_EFI)
71+
#include "acefiex.h"
72+
7173
#endif
7274

7375
/*! [End] no source code translation !*/

‎tools/power/acpi/common/cmfsize.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#include <acpi/acpi.h>
4545
#include "accommon.h"
4646
#include "acapps.h"
47-
#include <stdio.h>
4847

4948
#define _COMPONENT ACPI_TOOLS
5049
ACPI_MODULE_NAME("cmfsize")

‎tools/power/acpi/tools/acpidump/acpidump.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@
5656
#include "accommon.h"
5757
#include "actables.h"
5858

59-
#include <stdio.h>
60-
#include <fcntl.h>
61-
#include <errno.h>
62-
#include <sys/stat.h>
63-
6459
/* Globals */
6560

6661
EXTERN u8 INIT_GLOBAL(gbl_summary_mode, FALSE);

0 commit comments

Comments
 (0)