x86: Fix up type sizes for 64-bit
authorSimon Glass <sjg@chromium.org>
Mon, 16 Jan 2017 14:04:06 +0000 (07:04 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Mon, 6 Feb 2017 03:38:46 +0000 (11:38 +0800)
Adjust types as needed to support 64-bit compilation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/include/asm/posix_types.h
arch/x86/include/asm/types.h

index 5529f32702cd94017bb0593bf0faeb8cb4594f43..717f6cb8e01055615ccbd41d5d1f929804850ea4 100644 (file)
@@ -16,8 +16,13 @@ typedef int          __kernel_pid_t;
 typedef unsigned short __kernel_ipc_pid_t;
 typedef unsigned short __kernel_uid_t;
 typedef unsigned short __kernel_gid_t;
+#if CONFIG_IS_ENABLED(X86_64)
+typedef unsigned long  __kernel_size_t;
+typedef long           __kernel_ssize_t;
+#else
 typedef unsigned int   __kernel_size_t;
 typedef int            __kernel_ssize_t;
+#endif
 typedef int            __kernel_ptrdiff_t;
 typedef long           __kernel_time_t;
 typedef long           __kernel_suseconds_t;
index 880dcb488a5df933550ed204636b820ccffb2c35..a47e581fe3ab1f0ae9e046aeed97e5876c2ff448 100644 (file)
@@ -44,7 +44,12 @@ typedef __INT64_TYPE__ s64;
 typedef __UINT64_TYPE__ u64;
 #endif
 
+#if CONFIG_IS_ENABLED(X86_64)
+#define BITS_PER_LONG 64
+#else
 #define BITS_PER_LONG 32
+#endif
+
 /* Dma addresses are 32-bits wide.  */
 
 typedef u32 dma_addr_t;