Skip to content

Commit

Permalink
ACPICA: Fix failed target detection with bare-metal compiler
Browse files Browse the repository at this point in the history
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 <[email protected]>

 Conflicts:
	include/acpi/platform/acenv.h
  • Loading branch information
kdrag0n authored and SreekanthPalakurthi committed Sep 11, 2020
1 parent 92a111f commit ca94002
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/acpi/platform/acenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
*
*****************************************************************************/

#if defined(_LINUX) || defined(__linux__)
#if defined(_LINUX) || defined(__linux__) || defined(__KERNEL__)
#include <acpi/platform/aclinux.h>

#elif defined(_APPLE) || defined(__APPLE__)
Expand Down
2 changes: 1 addition & 1 deletion include/acpi/platform/acenvex.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
*
*****************************************************************************/

#if defined(_LINUX) || defined(__linux__)
#if defined(_LINUX) || defined(__linux__) || defined(__KERNEL__)
#include <acpi/platform/aclinuxex.h>

#elif defined(WIN32)
Expand Down

0 comments on commit ca94002

Please sign in to comment.