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 <danny@kdrag0n.dev>
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
This commit is contained in:
Danny Lin
2019-05-24 21:58:16 -07:00
committed by UtsavBalar1231
parent bc3dc4edf2
commit 8302aa7846
2 changed files with 2 additions and 2 deletions

View File

@@ -182,7 +182,7 @@
#endif
#if defined(_LINUX) || defined(__linux__)
#if defined(_LINUX) || defined(__linux__) || defined(__KERNEL__)
#include <acpi/platform/aclinux.h>
#elif defined(_APPLE) || defined(__APPLE__)

View File

@@ -53,7 +53,7 @@
*
*****************************************************************************/
#if defined(_LINUX) || defined(__linux__)
#if defined(_LINUX) || defined(__linux__) || defined(__KERNEL__)
#include <acpi/platform/aclinuxex.h>
#elif defined(__DragonFly__)