From ca940027126b7448e05765d672b55819a698388a Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Fri, 24 May 2019 21:58:16 -0700 Subject: [PATCH] ACPICA: Fix failed target detection with bare-metal compiler The target environment macro checks in ACPICA fail when the compiler targets bare-metal environments (i.e. plain ELF images) instead of Linux userspace environments. The predefined __linux__ macro is not defined in such cases, but this is all ACPICA checks for. Not being able to detect the target environment causes hundreds of compile errors to be emitted due to missing definitions, because those definitions are normally in target-specific headers. Fix the issue by using the proper method of detecting whether code is being compiled as part of the kernel (__KERNEL__) in the ACPICA target environment detection header, thus resulting in the appropriate target headers being included. Signed-off-by: Danny Lin Conflicts: include/acpi/platform/acenv.h --- include/acpi/platform/acenv.h | 2 +- include/acpi/platform/acenvex.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 056f245ad038..f98483390feb 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -170,7 +170,7 @@ * *****************************************************************************/ -#if defined(_LINUX) || defined(__linux__) +#if defined(_LINUX) || defined(__linux__) || defined(__KERNEL__) #include #elif defined(_APPLE) || defined(__APPLE__) diff --git a/include/acpi/platform/acenvex.h b/include/acpi/platform/acenvex.h index 2f296cb5f7e2..d254b9f3b2c3 100644 --- a/include/acpi/platform/acenvex.h +++ b/include/acpi/platform/acenvex.h @@ -53,7 +53,7 @@ * *****************************************************************************/ -#if defined(_LINUX) || defined(__linux__) +#if defined(_LINUX) || defined(__linux__) || defined(__KERNEL__) #include #elif defined(WIN32)