From patchwork Mon Aug 6 11:47:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 953845 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="2j8Aophe"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41kbw14VjFz9s4c for ; Mon, 6 Aug 2018 22:06:09 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id B9B6AC21DF9; Mon, 6 Aug 2018 12:06:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=KHOP_BIG_TO_CC, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A75B8C21C8B; Mon, 6 Aug 2018 12:06:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1BC2DC21E0F; Mon, 6 Aug 2018 11:49:10 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id A76F8C21C2F for ; Mon, 6 Aug 2018 11:48:58 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w76BllPT032023; Mon, 6 Aug 2018 20:47:49 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w76BllPT032023 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1533556070; bh=5hvK7XStbsc7BUBaoAKgIP6MK1UPkx9UVyeoJGPeWTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2j8Aophe0ATs29nSeUxnFWwrekSuqcMc3wTY+3hcf1pH8bQozoc1yQ72X3PYwP+Xh 0jyhcs6jM3kmJz1+bYbgtRmP3LXLDkjlug0emqx5l/K339u+4hZr0YSB/clBdVxvaC 1IvuVRoKFquopoWhp5PyFR3pyut5l6lIr8it0F6lALyxsB1A5OaJGI1UKDYii7X+H8 PiKSi5PN8AYTzZPNr20ce88n36L/D+2/nYfL8v7cSJnTGWan4c/AIqBbw+OfH4zldS +kIhQAr4U3MJ2tDqJV4AfzOyKOSiQNHerzkBRMrMZ1p533MsEa9V2N7fMSRsJy9E/V dSYvdrUTWvYbQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Mon, 6 Aug 2018 20:47:39 +0900 Message-Id: <1533556060-26284-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533556060-26284-1-git-send-email-yamada.masahiro@socionext.com> References: <1533556060-26284-1-git-send-email-yamada.masahiro@socionext.com> X-Mailman-Approved-At: Mon, 06 Aug 2018 12:06:00 +0000 Cc: Alexey Brodkin , uboot-snps-arc@synopsys.com, Andy Fleming , Stefan Roese , Marek Vasut , Tom Rini , Angelo Dureghello , Macpaul Lin , Eugeniy Paltsev , Scott McNutt , Huan Wang Subject: [U-Boot] [PATCH 2/3] arch: types.h: factor out fixed width typedefs to int-ll64.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" All architectures have the same definition for s8/16/32/64 and u8/16/32/64. Factor out the duplicated code into . BTW, Linux unified the kernel space definition into int-ll64.h a few years ago as you see in Linux commit 0c79a8e29b5f ("asm/types.h: Remove include/asm-generic/int-l64.h"). Signed-off-by: Masahiro Yamada --- arch/arc/include/asm/types.h | 36 ++-------------------------- arch/arm/include/asm/types.h | 33 ++------------------------ arch/m68k/include/asm/types.h | 30 ++--------------------- arch/microblaze/include/asm/types.h | 33 ++------------------------ arch/mips/include/asm/types.h | 36 ++-------------------------- arch/nds32/include/asm/types.h | 33 ++------------------------ arch/powerpc/include/asm/types.h | 30 ++--------------------- arch/riscv/include/asm/types.h | 33 ++------------------------ arch/sandbox/include/asm/types.h | 33 ++------------------------ arch/sh/include/asm/types.h | 34 ++------------------------- arch/x86/include/asm/types.h | 33 ++------------------------ arch/xtensa/include/asm/types.h | 33 ++------------------------ include/asm-generic/int-ll64.h | 47 +++++++++++++++++++++++++++++++++++++ include/asm-generic/types.h | 9 +++++++ 14 files changed, 80 insertions(+), 373 deletions(-) create mode 100644 include/asm-generic/int-ll64.h create mode 100644 include/asm-generic/types.h diff --git a/arch/arc/include/asm/types.h b/arch/arc/include/asm/types.h index 3e37781..f31dcdf 100644 --- a/arch/arc/include/asm/types.h +++ b/arch/arc/include/asm/types.h @@ -6,41 +6,9 @@ #ifndef __ASM_ARC_TYPES_H #define __ASM_ARC_TYPES_H -typedef unsigned short umode_t; - -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; +#include -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; +typedef unsigned short umode_t; #define BITS_PER_LONG 32 diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h index 9af7353..900b261 100644 --- a/arch/arm/include/asm/types.h +++ b/arch/arm/include/asm/types.h @@ -1,44 +1,15 @@ #ifndef __ASM_ARM_TYPES_H #define __ASM_ARM_TYPES_H -typedef unsigned short umode_t; - -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; +#include -#if defined(__GNUC__) -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#endif +typedef unsigned short umode_t; /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - #ifdef CONFIG_ARM64 #define BITS_PER_LONG 64 #else /* CONFIG_ARM64 */ diff --git a/arch/m68k/include/asm/types.h b/arch/m68k/include/asm/types.h index 3ffcab2..5d39b97 100644 --- a/arch/m68k/include/asm/types.h +++ b/arch/m68k/include/asm/types.h @@ -1,43 +1,17 @@ #ifndef _M68K_TYPES_H #define _M68K_TYPES_H +#include + #ifndef __ASSEMBLY__ typedef unsigned short umode_t; -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#endif - typedef struct { __u32 u[4]; } __attribute__((aligned(16))) vector128; #ifdef __KERNEL__ -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; #define BITS_PER_LONG 32 diff --git a/arch/microblaze/include/asm/types.h b/arch/microblaze/include/asm/types.h index 77094f6..056a313 100644 --- a/arch/microblaze/include/asm/types.h +++ b/arch/microblaze/include/asm/types.h @@ -1,6 +1,8 @@ #ifndef _ASM_TYPES_H #define _ASM_TYPES_H +#include + /* * This file is never included by application software unless * explicitly requested (e.g., via linux/types.h) in which case the @@ -12,41 +14,10 @@ typedef unsigned short umode_t; /* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#endif - -/* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - #define BITS_PER_LONG 32 /* Dma addresses are 32-bits wide. */ diff --git a/arch/mips/include/asm/types.h b/arch/mips/include/asm/types.h index 7032862..925d7ef 100644 --- a/arch/mips/include/asm/types.h +++ b/arch/mips/include/asm/types.h @@ -6,32 +6,12 @@ #ifndef _ASM_TYPES_H #define _ASM_TYPES_H +#include + #ifndef __ASSEMBLY__ typedef unsigned short umode_t; -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#else -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - #endif /* __ASSEMBLY__ */ /* @@ -43,18 +23,6 @@ typedef unsigned long long __u64; #ifndef __ASSEMBLY__ -typedef __signed char s8; -typedef unsigned char u8; - -typedef __signed short s16; -typedef unsigned short u16; - -typedef __signed int s32; -typedef unsigned int u32; - -typedef __signed__ long long s64; -typedef unsigned long long u64; - #if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \ || defined(CONFIG_64BIT) typedef u64 dma_addr_t; diff --git a/arch/nds32/include/asm/types.h b/arch/nds32/include/asm/types.h index 2e8924f..d2444da 100644 --- a/arch/nds32/include/asm/types.h +++ b/arch/nds32/include/asm/types.h @@ -11,44 +11,15 @@ #ifndef __ASM_NDS_TYPES_H #define __ASM_NDS_TYPES_H -typedef unsigned short umode_t; - -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; +#include -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif +typedef unsigned short umode_t; /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - #define BITS_PER_LONG 32 #include diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h index b29ce79..cc8d123 100644 --- a/arch/powerpc/include/asm/types.h +++ b/arch/powerpc/include/asm/types.h @@ -1,43 +1,17 @@ #ifndef _PPC_TYPES_H #define _PPC_TYPES_H +#include + #ifndef __ASSEMBLY__ typedef unsigned short umode_t; -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#endif - typedef struct { __u32 u[4]; } __attribute__((aligned(16))) vector128; #ifdef __KERNEL__ -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; #define BITS_PER_LONG 32 diff --git a/arch/riscv/include/asm/types.h b/arch/riscv/include/asm/types.h index 9797206..bd86271 100644 --- a/arch/riscv/include/asm/types.h +++ b/arch/riscv/include/asm/types.h @@ -12,44 +12,15 @@ #ifndef __ASM_RISCV_TYPES_H #define __ASM_RISCV_TYPES_H -typedef unsigned short umode_t; - -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; +#include -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif +typedef unsigned short umode_t; /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - #define BITS_PER_LONG 32 #include diff --git a/arch/sandbox/include/asm/types.h b/arch/sandbox/include/asm/types.h index 79c85aa..7cd56b4 100644 --- a/arch/sandbox/include/asm/types.h +++ b/arch/sandbox/include/asm/types.h @@ -6,44 +6,15 @@ #ifndef __ASM_SANDBOX_TYPES_H #define __ASM_SANDBOX_TYPES_H -typedef unsigned short umode_t; - -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; +#include -#if defined(__GNUC__) -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#endif +typedef unsigned short umode_t; /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - /* * Number of bits in a C 'long' on this architecture. */ diff --git a/arch/sh/include/asm/types.h b/arch/sh/include/asm/types.h index aed4a6e..c5ddbbd 100644 --- a/arch/sh/include/asm/types.h +++ b/arch/sh/include/asm/types.h @@ -1,29 +1,12 @@ #ifndef __ASM_SH_TYPES_H #define __ASM_SH_TYPES_H +#include + #ifndef __ASSEMBLY__ typedef unsigned short umode_t; -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#endif - #endif /* __ASSEMBLY__ */ /* @@ -35,19 +18,6 @@ __extension__ typedef unsigned long long __u64; #ifndef __ASSEMBLY__ - -typedef __signed__ char s8; -typedef unsigned char u8; - -typedef __signed__ short s16; -typedef unsigned short u16; - -typedef __signed__ int s32; -typedef unsigned int u32; - -typedef __signed__ long long s64; -typedef unsigned long long u64; - /* Dma addresses are 32-bits wide. */ typedef u32 dma_addr_t; diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h index 7649c2b..ba50001 100644 --- a/arch/x86/include/asm/types.h +++ b/arch/x86/include/asm/types.h @@ -1,44 +1,15 @@ #ifndef __ASM_I386_TYPES_H #define __ASM_I386_TYPES_H -typedef unsigned short umode_t; - -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; +#include -#if defined(__GNUC__) -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#endif +typedef unsigned short umode_t; /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - #if CONFIG_IS_ENABLED(X86_64) #define BITS_PER_LONG 64 #else diff --git a/arch/xtensa/include/asm/types.h b/arch/xtensa/include/asm/types.h index bae1a48..2c5b543 100644 --- a/arch/xtensa/include/asm/types.h +++ b/arch/xtensa/include/asm/types.h @@ -6,44 +6,15 @@ #ifndef _XTENSA_TYPES_H #define _XTENSA_TYPES_H -typedef unsigned short umode_t; - -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; +#include -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif +typedef unsigned short umode_t; /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - #define BITS_PER_LONG 32 /* Dma addresses are 32-bits wide */ diff --git a/include/asm-generic/int-ll64.h b/include/asm-generic/int-ll64.h new file mode 100644 index 0000000..7451718 --- /dev/null +++ b/include/asm-generic/int-ll64.h @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * asm-generic/int-ll64.h + * + * Integer declarations for architectures which use "long long" + * for 64-bit types. + */ + +#ifndef _ASM_GENERIC_INT_LL64_H +#define _ASM_GENERIC_INT_LL64_H + +#ifndef __ASSEMBLY__ +/* + * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the + * header files exported to user space + */ + +typedef __signed__ char __s8; +typedef unsigned char __u8; + +typedef __signed__ short __s16; +typedef unsigned short __u16; + +typedef __signed__ int __s32; +typedef unsigned int __u32; + +#ifdef __GNUC__ +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; +#else +typedef __signed__ long long __s64; +typedef unsigned long long __u64; +#endif + +typedef __s8 s8; +typedef __u8 u8; +typedef __s16 s16; +typedef __u16 u16; +typedef __s32 s32; +typedef __u32 u32; +typedef __s64 s64; +typedef __u64 u64; + +#endif /* __ASSEMBLY__ */ + + +#endif /* _ASM_GENERIC_INT_LL64_H */ diff --git a/include/asm-generic/types.h b/include/asm-generic/types.h new file mode 100644 index 0000000..7c076c5 --- /dev/null +++ b/include/asm-generic/types.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_GENERIC_TYPES_H +#define _ASM_GENERIC_TYPES_H +/* + * int-ll64 is used everywhere now. + */ +#include + +#endif /* _ASM_GENERIC_TYPES_H */