diff mbox

[U-Boot,v3,41/62] x86: Fix up type sizes for 64-bit

Message ID 20170116140427.29283-42-sjg@chromium.org
State Accepted
Delegated to: Bin Meng
Headers show

Commit Message

Simon Glass Jan. 16, 2017, 2:04 p.m. UTC
Adjust types as needed to support 64-bit compilation.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 arch/x86/include/asm/posix_types.h | 5 +++++
 arch/x86/include/asm/types.h       | 5 +++++
 2 files changed, 10 insertions(+)

Comments

Bin Meng Jan. 17, 2017, 4:03 a.m. UTC | #1
On Mon, Jan 16, 2017 at 10:04 PM, Simon Glass <sjg@chromium.org> wrote:
> Adjust types as needed to support 64-bit compilation.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  arch/x86/include/asm/posix_types.h | 5 +++++
>  arch/x86/include/asm/types.h       | 5 +++++
>  2 files changed, 10 insertions(+)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Bin Meng Jan. 17, 2017, 4:19 a.m. UTC | #2
On Tue, Jan 17, 2017 at 12:03 PM, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Mon, Jan 16, 2017 at 10:04 PM, Simon Glass <sjg@chromium.org> wrote:
>> Adjust types as needed to support 64-bit compilation.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>> Changes in v3: None
>> Changes in v2: None
>>
>>  arch/x86/include/asm/posix_types.h | 5 +++++
>>  arch/x86/include/asm/types.h       | 5 +++++
>>  2 files changed, 10 insertions(+)
>>
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86, thanks!
diff mbox

Patch

diff --git a/arch/x86/include/asm/posix_types.h b/arch/x86/include/asm/posix_types.h
index 5529f32702c..717f6cb8e01 100644
--- a/arch/x86/include/asm/posix_types.h
+++ b/arch/x86/include/asm/posix_types.h
@@ -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;
diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h
index 880dcb488a5..a47e581fe3a 100644
--- a/arch/x86/include/asm/types.h
+++ b/arch/x86/include/asm/types.h
@@ -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;