armv8: Use __aarch64__ rather than CONFIG_ARM64 in some cases
authorTom Rini <trini@ti.com>
Thu, 9 Jan 2014 20:11:27 +0000 (15:11 -0500)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Fri, 10 Jan 2014 09:10:23 +0000 (10:10 +0100)
The toolchain sets __aarch64__ for both LE and BE.  In the case of
posix_types.h we cannot reliably use config.h as that will lead to
problems.  In the case of byteorder.h it's clearer to check the EB flag
being set in either case instead.

Cc: David Feng <fenghua@phytium.com.cn>
Signed-off-by: Tom Rini <trini@ti.com>
Amended by Albert ARIBAUD <albert.u.boot@aribaud.net> to
actually remove the config.h include from the posix_types.h
files, with permission from Tom Rini.

arch/arm/include/asm/byteorder.h
arch/arm/include/asm/posix_types.h

index 71a9966301d05ed366b9d89f25dcdd63af7ca8a2..20cce7657e1059a170fd5ef32688cb96064fcd7f 100644 (file)
 #  define __SWAB_64_THRU_32__
 #endif
 
-#ifdef CONFIG_ARM64
-
-#ifdef __AARCH64EB__
-#include <linux/byteorder/big_endian.h>
-#else
-#include <linux/byteorder/little_endian.h>
-#endif
-
-#else  /* CONFIG_ARM64 */
-
-#ifdef __ARMEB__
+#if defined(__ARMEB__) || defined(__AARCH64EB__)
 #include <linux/byteorder/big_endian.h>
 #else
 #include <linux/byteorder/little_endian.h>
 #endif
 
-#endif /* CONFIG_ARM64 */
-
 #endif
index 9ba9add4f7d4cc74a1776ce3b5974a725cd9fd5e..d254b95b2ab652f39cf9fc63361d6b358a9d54bb 100644 (file)
@@ -13,8 +13,6 @@
 #ifndef __ARCH_ARM_POSIX_TYPES_H
 #define __ARCH_ARM_POSIX_TYPES_H
 
-#include <config.h>
-
 /*
  * This file is generally used by user-level software, so you need to
  * be a little careful about namespace pollution etc.  Also, we cannot
@@ -31,15 +29,15 @@ typedef unsigned short              __kernel_ipc_pid_t;
 typedef unsigned short         __kernel_uid_t;
 typedef unsigned short         __kernel_gid_t;
 
-#ifdef CONFIG_ARM64
+#ifdef __aarch64__
 typedef unsigned long          __kernel_size_t;
 typedef long                   __kernel_ssize_t;
 typedef long                   __kernel_ptrdiff_t;
-#else  /* CONFIG_ARM64 */
+#else
 typedef unsigned int           __kernel_size_t;
 typedef int                    __kernel_ssize_t;
 typedef int                    __kernel_ptrdiff_t;
-#endif /* CONFIG_ARM64 */
+#endif
 
 typedef long                   __kernel_time_t;
 typedef long                   __kernel_suseconds_t;