[U-Boot] [PATCH 7/7] Make BITS_PER_LONG compiler-dependent (MAD)

Simon Glass sjg at chromium.org
Tue Dec 23 05:51:41 CET 2014


Hi Masahiro,

On 22 December 2014 at 03:16, Masahiro Yamada <yamada.m at jp.panasonic.com> wrote:
> Linux expects "unsigned long" has the same bit-width as the pointer,
> i.e. the size of "unsigned long" is 4 on 32-bit compilers (ILP32)
> and it is 8 on 64-bit compilers (LLP64).
> It provides us the convenience in return of the limitation that
> LP64 data model is not supported.
>
> U-Boot used to follow Linux's way, but it does not now.
>
> Including <stdint.h> means the width of "long" type is provided by
> the compiler.
>
> Use __SIZEOF_LONG__ instead of hard-coding BITS_PER_LONG.
>

>From what I can tell the size of the types is no different with and
without stdint.h. It is just the names of the typedefs that are used
for each type that changes. So if we follow the kernel approach, maybe
this patch isn't needed either?

> Signed-off-by: Masahiro Yamada <yamada.m at jp.panasonic.com>
> Cc: Gabe Black <gabeblack at chromium.org>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Bill Richardson <wfrichar at google.com>
> Cc: Tom Rini <trini at ti.com>
> ---
>
>  arch/arc/include/asm/types.h        | 4 ++++
>  arch/arm/include/asm/types.h        | 4 ++++
>  arch/avr32/include/asm/types.h      | 4 ++++
>  arch/blackfin/include/asm/types.h   | 4 ++++
>  arch/m68k/include/asm/types.h       | 4 ++++
>  arch/microblaze/include/asm/types.h | 4 ++++
>  arch/mips/include/asm/types.h       | 4 ++++
>  arch/nds32/include/asm/types.h      | 4 ++++
>  arch/nios2/include/asm/types.h      | 4 ++++
>  arch/openrisc/include/asm/types.h   | 4 ++++
>  arch/powerpc/include/asm/types.h    | 4 ++++
>  arch/sandbox/include/asm/types.h    | 4 ++++
>  arch/sh/include/asm/types.h         | 4 ++++
>  arch/sparc/include/asm/types.h      | 4 ++++
>  arch/x86/include/asm/types.h        | 4 ++++
>  15 files changed, 60 insertions(+)
>

[snip]

Regards,
Simon


More information about the U-Boot mailing list