From da24f31d33dd18c622bb4f21791565ab9b6421db Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Thu, 4 Aug 2016 16:44:44 +0800 Subject: ACPICA: Clib: Fix wrong mini C library usage ACPICA commit 4aab18466b56f3660f27cffd3c0160900737f844 When mini C library is used, we should have the following macros undefined. The only user should be the EFI applications: ACPI_USE_SYSTEM_CLIBRARY=n ACPI_USE_STANDARD_HEADERS=n All other applications uses the compiler specific library: ACPI_USE_SYSTEM_CLIBRARY=y ACPI_USE_STANDARD_HEADERS=y Linux/BSD kernels are the kind of hosts providing C library but does not provide the standard headers: ACPI_USE_SYSTEM_CLIBRARY=y ACPI_USE_STANDARD_HEADERS=n But the above logic hasn't been synchronized between the header files. This patch synchronizes all header files to correct C library usages for different platforms. This patch moves all ACPI_USE_SYSTEM_CLIRARY and ACPI_USE_STANDARD_HEADERS to the top most lines of a platform specific header. After synchronization, ACPI_USE_SYSTEM_CLIRARY definition can be removed for ACPI_APPLICATION. Lv Zheng. Link: https://github.com/acpica/acpica/commit/4aab1846 Link: https://bugs.acpica.org/show_bug.cgi?id=1299 Signed-off-by: Lv Zheng Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- include/acpi/platform/acenv.h | 7 ++----- include/acpi/platform/aclinux.h | 7 ++++--- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'include/acpi/platform') diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index f40511335a98..ee5c0b98e53a 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -149,7 +149,6 @@ /* Common for all ACPICA applications */ #ifdef ACPI_APPLICATION -#define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_LOCAL_CACHE #endif @@ -326,7 +325,8 @@ * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library. * Otherwise, local versions of string/memory functions will be used. * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and - * the standard header files may be used. + * the standard header files may be used. Defining this implies that + * ACPI_USE_SYSTEM_CLIBRARY has been defined. * * The ACPICA subsystem only uses low level C library functions that do not * call operating system services and may therefore be inlined in the code. @@ -334,7 +334,6 @@ * It may be necessary to tailor these include files to the target * generation environment. */ -#ifdef ACPI_USE_SYSTEM_CLIBRARY /* Use the standard C library headers. We want to keep these to a minimum. */ @@ -348,8 +347,6 @@ #endif /* ACPI_USE_STANDARD_HEADERS */ -#endif /* ACPI_USE_SYSTEM_CLIBRARY */ - #ifndef ACPI_FILE #ifdef ACPI_APPLICATION #include diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 447c33f303b0..1380ec7035f8 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -180,10 +180,11 @@ #else /* !__KERNEL__ */ -#include -#include -#include +#define ACPI_USE_STANDARD_HEADERS + +#ifdef ACPI_USE_STANDARD_HEADERS #include +#endif /* Define/disable kernel-specific declarators */ -- cgit v1.2.3