Introduce asm-generic/posix_types.h

Sascha Hauer s.hauer at pengutronix.de
Thu May 21 23:10:57 PDT 2015


asm/posix_types.h adds several posix variable types for each architecture.
This is unnecessary code duplication. Since the files are derived from
Linux they have some real differences, but they are irrelevant to barebox.
For example __kernel_mode_t is unsigned int on some architectures and
unsigned short on others. Since we have no userspace we have to stay
compatible to we can use the same type for all architectures. Some
32bit architectures use unsigned long where others use unsigned int, but
since both are 32bit types we can use the same type for all architectures.
Finally there are types which are different between 32bit and 64bit
architectures, these are handled by the BITS_PER_LONG macro defined
in asm/bitsperlong.h which is added for the architectures that do not
have this file already.

----------------------------------------------------------------
Sascha Hauer (14):
      dma: Use generic place for dma_addr_t typedef
      drop __BITS_PER_LONG
      introduce bitsperlong.h for remaining architectures
      introduce generic posix_types.h
      remove unused nlink_t
      ARM: use generic posix_types.h
      blackfin: use generic posix_types.h
      x86: use generic posix_types.h
      openrisc: use generic posix_types.h
      mips: use generic posix_types.h
      ppc: use generic posix_types.h
      sandbox: use generic posix_types.h
      efi: use generic posix_types.h
      nios2: use generic posix_types.h

 arch/arm/include/asm/bitsperlong.h      |   1 +
 arch/arm/include/asm/posix_types.h      |  79 +------------------
 arch/arm/include/asm/types.h            |   7 +-
 arch/blackfin/include/asm/posix_types.h |  86 +--------------------
 arch/blackfin/include/asm/types.h       |   6 +-
 arch/efi/include/asm/bitsperlong.h      |  10 +++
 arch/efi/include/asm/posix_types.h      |  94 +----------------------
 arch/efi/include/asm/types.h            |  10 +--
 arch/mips/Kconfig                       |   1 +
 arch/mips/include/asm/bitsperlong.h     |   4 +-
 arch/mips/include/asm/posix_types.h     | 130 +-------------------------------
 arch/mips/include/asm/types.h           |  12 ---
 arch/nios2/include/asm/posix_types.h    |  78 +------------------
 arch/nios2/include/asm/types.h          |   3 -
 arch/openrisc/include/asm/bitsperlong.h |   1 +
 arch/openrisc/include/asm/posix_types.h |  72 +-----------------
 arch/openrisc/include/asm/types.h       |   6 +-
 arch/ppc/include/asm/bitsperlong.h      |   1 +
 arch/ppc/include/asm/posix_types.h      | 109 +-------------------------
 arch/ppc/include/asm/types.h            |   5 +-
 arch/sandbox/include/asm/bitsperlong.h  |  10 +++
 arch/sandbox/include/asm/posix_types.h  |  94 +----------------------
 arch/sandbox/include/asm/types.h        |   6 +-
 arch/x86/include/asm/bitsperlong.h      |   1 +
 arch/x86/include/asm/posix_types.h      |  45 +----------
 arch/x86/include/asm/types.h            |   2 +-
 common/Kconfig                          |   3 +
 include/asm-generic/bitsperlong.h       |  22 ------
 include/asm-generic/posix_types.h       |  90 ++++++++++++++++++++++
 include/asm-generic/swab.h              |   2 +-
 include/linux/types.h                   |   8 +-
 31 files changed, 143 insertions(+), 855 deletions(-)
 create mode 100644 arch/arm/include/asm/bitsperlong.h
 create mode 100644 arch/efi/include/asm/bitsperlong.h
 create mode 100644 arch/openrisc/include/asm/bitsperlong.h
 create mode 100644 arch/ppc/include/asm/bitsperlong.h
 create mode 100644 arch/sandbox/include/asm/bitsperlong.h
 create mode 100644 arch/x86/include/asm/bitsperlong.h
 create mode 100644 include/asm-generic/posix_types.h



More information about the barebox mailing list