Skip to contentSkip to conversation

Unify integer type definitions, and add fixed type constructor macros

PATCH In review H. Peter Anvin 12 participants 70 messages Apr 24, 2008 – Apr 28, 2008 1 message not in the archive Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

cover Unify integer type definitions, and add fixed type constructor macros

This patchset unifies the integer definitions across all the <asm-*/types.h> files, replacing them with two asm-generic files, one for the LL64 model (all 32-bit architectures plus x86-64) and one for the L64 model (all other 64-bit architectures.)

The latter patches introduce constructor macros, similar to the C99 <inttypes.h> macros, e.g. U64_C(0x123456789abcdef), which produces the same result as (u64)0x123456789abcdef but (a) is usable in the preprocessor, (b) doesn't generate warnings, (c) is transparently ignored for assembly.

The final patch uses said constructor macros to remove nuisance warnings from kernel/time.c.

This patchset is also pullable as a git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-inttypes.git

 include/asm-alpha/types.h      |   36 +---------------
 include/asm-arm/types.h        |   33 +-------------
 include/asm-avr32/types.h      |   32 +------------
 include/asm-blackfin/types.h   |   34 +-------------
 include/asm-cris/types.h       |   33 +-------------
 include/asm-frv/types.h        |   34 +-------------
 include/asm-generic/Kbuild     |    2 +
 include/asm-generic/int-l64.h  |   71 +++++++++++++++++++++++++++++
 include/asm-generic/int-ll64.h |   76 ++++++++++++++++++++++++++++++++
 include/asm-h8300/types.h      |   33 +-------------
 include/asm-ia64/types.h       |   31 +------------
 include/asm-m32r/types.h       |   32 +------------
 include/asm-m68k/types.h       |   32 +-------------
 include/asm-mips/types.h       |   56 +++---------------------
 include/asm-mn10300/types.h    |   33 +-------------
 include/asm-parisc/types.h     |   33 +-------------
 include/asm-powerpc/types.h    |   48 +++-----------------
 include/asm-s390/types.h       |   48 +++-----------------
 include/asm-sh/types.h         |   34 +-------------
 include/asm-sparc/types.h      |   30 +------------
 include/asm-sparc64/types.h    |   30 +------------
 include/asm-v850/types.h       |   32 +-------------
 include/asm-x86/types.h        |   38 +---------------
 include/asm-xtensa/types.h     |   33 +-------------
 kernel/time.c                  |    8 ++--
 25 files changed, 201 insertions(+), 701 deletions(-)
#2 lore raw

PATCH 1/24 types: create <asm-generic/int-*.h>

In reply to a message not in the archive

This creates two generic files with common integer definitions; one where 64 bits is "long" (most 64-bit architectures) and one where 64 bits is "long long" (all 32-bit architectures and x86-64.)

---
 include/asm-generic/Kbuild     |    2 +
 include/asm-generic/int-l64.h  |   51 ++++++++++++++++++++++++++++++++++++
 include/asm-generic/int-ll64.h |   56 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 109 insertions(+), 0 deletions(-)
 create mode 100644 include/asm-generic/int-l64.h
 create mode 100644 include/asm-generic/int-ll64.h
include/asm-generic/Kbuild +2 -0
index c18110e..4c9932a 100644
@@ -7,5 +7,7 @@ header-y += poll.h
 header-y += signal.h
 header-y += statfs.h
 
+unifdef-y += int-l64.h
+unifdef-y += int-ll64.h
 unifdef-y += resource.h
 unifdef-y += siginfo.h
include/asm-generic/int-l64.h new file +51 -0

51 lines not on this page · raw message

include/asm-generic/int-ll64.h new file +56 -0

56 lines not on this page · raw message

Signature · 1 line
1.5.4.1
#3 lore raw

PATCH 2/24 alpha: types: use <asm-generic/int-*.h> for the alpha architecture

This modifies <asm-alpha/types.h> to use the <asm-generic/int-*.h> generic include files.

Cc Richard Henderson <[email protected]>
Cc Ivan Kokshaysky <ink-biIs/[email protected]>
---
 include/asm-alpha/types.h |   36 +-----------------------------------
 1 files changed, 1 insertions(+), 35 deletions(-)
include/asm-alpha/types.h +1 -35
index f571613..a9e34ca 100644
@@ -8,28 +8,12 @@
  * not a major issue.  However, for interoperability, libraries still
  * need to be careful to avoid a name clashes.
  */
+#include <asm-generic/int-l64.h>
 
 #ifndef __ASSEMBLY__
 
 typedef unsigned int 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;
-
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-
 #endif /* __ASSEMBLY__ */
 
 /*
@@ -39,23 +23,5 @@ typedef unsigned long __u64;
 
 #define BITS_PER_LONG 64
 
-#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 s64;
-typedef unsigned long u64;
-
-typedef u64 dma_addr_t;
-typedef u64 dma64_addr_t;
-
-#endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* _ALPHA_TYPES_H */
Signature · 1 line
1.5.4.1
#4 lore raw

PATCH 2/24 alpha: types: use <asm-generic/int-*.h> for the alpha architecture

This modifies <asm-alpha/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-alpha/types.h |   36 +-----------------------------------
 1 files changed, 1 insertions(+), 35 deletions(-)
include/asm-alpha/types.h +1 -35
index f571613..a9e34ca 100644
@@ -8,28 +8,12 @@
  * not a major issue.  However, for interoperability, libraries still
  * need to be careful to avoid a name clashes.
  */
+#include <asm-generic/int-l64.h>
 
 #ifndef __ASSEMBLY__
 
 typedef unsigned int 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;
-
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-
 #endif /* __ASSEMBLY__ */
 
 /*
@@ -39,23 +23,5 @@ typedef unsigned long __u64;
 
 #define BITS_PER_LONG 64
 
-#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 s64;
-typedef unsigned long u64;
-
-typedef u64 dma_addr_t;
-typedef u64 dma64_addr_t;
-
-#endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* _ALPHA_TYPES_H */
Signature · 1 line
1.5.4.1
#5 lore raw

PATCH 3/24 arm: types: use <asm-generic/int-*.h> for the arm architecture

This modifies <asm-arm/types.h> to use the <asm-generic/int-*.h> generic include files.

Cc Russell King <rmk-lFZ/[email protected]>
Cc Lennert Buytenhek <kernel-OLH4Qvv75CYX/[email protected]>
Cc Ben Dooks <[email protected]>
---
 include/asm-arm/types.h |   33 ++-------------------------------
 1 files changed, 2 insertions(+), 31 deletions(-)
include/asm-arm/types.h +2 -31
index 3141451..345df01 100644
@@ -1,29 +1,12 @@
 #ifndef __ASM_ARM_TYPES_H
 #define __ASM_ARM_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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,18 +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;
Signature · 1 line
1.5.4.1
#6 lore raw

PATCH 3/24 arm: types: use <asm-generic/int-*.h> for the arm architecture

This modifies <asm-arm/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-arm/types.h |   33 ++-------------------------------
 1 files changed, 2 insertions(+), 31 deletions(-)
include/asm-arm/types.h +2 -31
index 3141451..345df01 100644
@@ -1,29 +1,12 @@
 #ifndef __ASM_ARM_TYPES_H
 #define __ASM_ARM_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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,18 +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;
Signature · 1 line
1.5.4.1
#7 lore raw

PATCH 4/24 avr32: types: use <asm-generic/int-*.h> for the avr32 architecture

This modifies <asm-avr32/types.h> to use the <asm-generic/int-*.h> generic include files.

Cc Haavard Skinnemoen <[email protected]>
---
 include/asm-avr32/types.h |   32 ++------------------------------
 1 files changed, 2 insertions(+), 30 deletions(-)
include/asm-avr32/types.h +2 -30
index 8999a38..9cefda6 100644
@@ -8,28 +8,12 @@
 #ifndef __ASM_AVR32_TYPES_H
 #define __ASM_AVR32_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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__ */
 
 /*
@@ -41,18 +25,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;
Signature · 1 line
1.5.4.1
#8 lore raw

PATCH 4/24 avr32: types: use <asm-generic/int-*.h> for the avr32 architecture

This modifies <asm-avr32/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-avr32/types.h |   32 ++------------------------------
 1 files changed, 2 insertions(+), 30 deletions(-)
include/asm-avr32/types.h +2 -30
index 8999a38..9cefda6 100644
@@ -8,28 +8,12 @@
 #ifndef __ASM_AVR32_TYPES_H
 #define __ASM_AVR32_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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__ */
 
 /*
@@ -41,18 +25,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;
Signature · 1 line
1.5.4.1
#9 lore raw

PATCH 5/24 blackfin: types: use <asm-generic/int-*.h> for the blackfin architecture

This modifies <asm-blackfin/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-blackfin/types.h |   34 ++--------------------------------
 1 files changed, 2 insertions(+), 32 deletions(-)
include/asm-blackfin/types.h +2 -32
index 9785a6d..8441cbc 100644
@@ -8,30 +8,12 @@
  * not a major issue.  However, for interoperability, libraries still
  * need to be careful to avoid a name clashes.
  */
+#include <asm-generic/int-ll64.h>
+
 #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;
-
-/* HK0617   -- Changes to unsigned long temporarily */
-#if defined(__GNUC__)
-__extension__ typedef __signed__ long long __s64;
-__extension__ typedef unsigned long long __u64;
-#endif
-
 #endif				/* __ASSEMBLY__ */
 /*
  * These aren't exported outside the kernel to avoid name space clashes
@@ -42,18 +24,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;
Signature · 1 line
1.5.4.1
#10 lore raw

PATCH 5/24 blackfin: types: use <asm-generic/int-*.h> for the blackfin architecture

This modifies <asm-blackfin/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-blackfin/types.h |   34 ++--------------------------------
 1 files changed, 2 insertions(+), 32 deletions(-)
include/asm-blackfin/types.h +2 -32
index 9785a6d..8441cbc 100644
@@ -8,30 +8,12 @@
  * not a major issue.  However, for interoperability, libraries still
  * need to be careful to avoid a name clashes.
  */
+#include <asm-generic/int-ll64.h>
+
 #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;
-
-/* HK0617   -- Changes to unsigned long temporarily */
-#if defined(__GNUC__)
-__extension__ typedef __signed__ long long __s64;
-__extension__ typedef unsigned long long __u64;
-#endif
-
 #endif				/* __ASSEMBLY__ */
 /*
  * These aren't exported outside the kernel to avoid name space clashes
@@ -42,18 +24,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;
Signature · 1 line
1.5.4.1
#11 lore raw

PATCH 6/24 cris: types: use <asm-generic/int-*.h> for the cris architecture

This modifies <asm-cris/types.h> to use the <asm-generic/int-*.h> generic include files.

Cc Mikael Starvik <[email protected]>
Cc Jesper Nilsson <[email protected]>
---
 include/asm-cris/types.h |   33 ++-------------------------------
 1 files changed, 2 insertions(+), 31 deletions(-)
include/asm-cris/types.h +2 -31
index 5a21c42..5790262 100644
@@ -1,29 +1,12 @@
 #ifndef _ETRAX_TYPES_H
 #define _ETRAX_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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,18 +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, just like our other addresses.  */
  
 typedef u32 dma_addr_t;
Signature · 1 line
1.5.4.1
#12 lore raw

PATCH 6/24 cris: types: use <asm-generic/int-*.h> for the cris architecture

This modifies <asm-cris/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-cris/types.h |   33 ++-------------------------------
 1 files changed, 2 insertions(+), 31 deletions(-)
include/asm-cris/types.h +2 -31
index 5a21c42..5790262 100644
@@ -1,29 +1,12 @@
 #ifndef _ETRAX_TYPES_H
 #define _ETRAX_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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,18 +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, just like our other addresses.  */
  
 typedef u32 dma_addr_t;
Signature · 1 line
1.5.4.1
#13 lore raw

PATCH 7/24 frv: types: use <asm-generic/int-*.h> for the frv architecture

This modifies <asm-frv/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-frv/types.h |   34 ++--------------------------------
 1 files changed, 2 insertions(+), 32 deletions(-)
include/asm-frv/types.h +2 -32
index 767e5ed..613bf1e 100644
@@ -12,29 +12,12 @@
 #ifndef _ASM_TYPES_H
 #define _ASM_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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__ */
 
 /*
@@ -46,19 +29,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;
Signature · 1 line
1.5.4.1
#14 lore raw

PATCH 7/24 frv: types: use <asm-generic/int-*.h> for the frv architecture

This modifies <asm-frv/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-frv/types.h |   34 ++--------------------------------
 1 files changed, 2 insertions(+), 32 deletions(-)
include/asm-frv/types.h +2 -32
index 767e5ed..613bf1e 100644
@@ -12,29 +12,12 @@
 #ifndef _ASM_TYPES_H
 #define _ASM_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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__ */
 
 /*
@@ -46,19 +29,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;
Signature · 1 line
1.5.4.1
#15 lore raw

PATCH 8/24 h8300: types: use <asm-generic/int-*.h> for the h8300 architecture

This modifies <asm-h8300/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-h8300/types.h |   33 ++-------------------------------
 1 files changed, 2 insertions(+), 31 deletions(-)
include/asm-h8300/types.h +2 -31
index 56566e2..1287519 100644
@@ -1,6 +1,8 @@
 #ifndef _H8300_TYPES_H
 #define _H8300_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #if !defined(__ASSEMBLY__)
 
 /*
@@ -14,41 +16,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.  */
Signature · 1 line
1.5.4.1
#16 lore raw

PATCH 8/24 h8300: types: use <asm-generic/int-*.h> for the h8300 architecture

This modifies <asm-h8300/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-h8300/types.h |   33 ++-------------------------------
 1 files changed, 2 insertions(+), 31 deletions(-)
include/asm-h8300/types.h +2 -31
index 56566e2..1287519 100644
@@ -1,6 +1,8 @@
 #ifndef _H8300_TYPES_H
 #define _H8300_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #if !defined(__ASSEMBLY__)
 
 /*
@@ -14,41 +16,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.  */
Signature · 1 line
1.5.4.1
#17 lore raw

PATCH 9/24 ia64: types: use <asm-generic/int-*.h> for the ia64 architecture

This modifies <asm-ia64/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-ia64/types.h |   31 ++-----------------------------
 1 files changed, 2 insertions(+), 29 deletions(-)
include/asm-ia64/types.h +2 -29
index 902850d..e36b371 100644
@@ -13,6 +13,8 @@
  *	David Mosberger-Tang <[email protected]>, Hewlett-Packard Co
  */
 
+#include <asm-generic/int-l64.h>
+
 #ifdef __ASSEMBLY__
 # define __IA64_UL(x)		(x)
 # define __IA64_UL_CONST(x)	x
@@ -28,39 +30,10 @@
 typedef unsigned int 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;
-
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-
-/*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 # ifdef __KERNEL__
 
-typedef __s8 s8;
-typedef __u8 u8;
-
-typedef __s16 s16;
-typedef __u16 u16;
-
-typedef __s32 s32;
-typedef __u32 u32;
-
-typedef __s64 s64;
-typedef __u64 u64;
-
 #define BITS_PER_LONG 64
 
 /* DMA addresses are 64-bits wide, in general.  */
Signature · 1 line
1.5.4.1
#18 lore raw

PATCH 9/24 ia64: types: use <asm-generic/int-*.h> for the ia64 architecture

This modifies <asm-ia64/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-ia64/types.h |   31 ++-----------------------------
 1 files changed, 2 insertions(+), 29 deletions(-)
include/asm-ia64/types.h +2 -29
index 902850d..e36b371 100644
@@ -13,6 +13,8 @@
  *	David Mosberger-Tang <[email protected]>, Hewlett-Packard Co
  */
 
+#include <asm-generic/int-l64.h>
+
 #ifdef __ASSEMBLY__
 # define __IA64_UL(x)		(x)
 # define __IA64_UL_CONST(x)	x
@@ -28,39 +30,10 @@
 typedef unsigned int 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;
-
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-
-/*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 # ifdef __KERNEL__
 
-typedef __s8 s8;
-typedef __u8 u8;
-
-typedef __s16 s16;
-typedef __u16 u16;
-
-typedef __s32 s32;
-typedef __u32 u32;
-
-typedef __s64 s64;
-typedef __u64 u64;
-
 #define BITS_PER_LONG 64
 
 /* DMA addresses are 64-bits wide, in general.  */
Signature · 1 line
1.5.4.1
#19 lore raw

PATCH 10/24 m32r: types: use <asm-generic/int-*.h> for the m32r architecture

This modifies <asm-m32r/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-m32r/types.h |   32 ++------------------------------
 1 files changed, 2 insertions(+), 30 deletions(-)
include/asm-m32r/types.h +2 -30
index b64c166..bc9f7ff 100644
@@ -1,28 +1,12 @@
 #ifndef _ASM_M32R_TYPES_H
 #define _ASM_M32R_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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__ */
 
 /*
@@ -34,18 +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;
Signature · 1 line
1.5.4.1
#20 lore raw

PATCH 10/24 m32r: types: use <asm-generic/int-*.h> for the m32r architecture

This modifies <asm-m32r/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-m32r/types.h |   32 ++------------------------------
 1 files changed, 2 insertions(+), 30 deletions(-)
include/asm-m32r/types.h +2 -30
index b64c166..bc9f7ff 100644
@@ -1,28 +1,12 @@
 #ifndef _ASM_M32R_TYPES_H
 #define _ASM_M32R_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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__ */
 
 /*
@@ -34,18 +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;
Signature · 1 line
1.5.4.1
#21 lore raw

PATCH 11/24 m68k: types: use <asm-generic/int-*.h> for the m68k architecture

This modifies <asm-m68k/types.h> to use the <asm-generic/int-*.h> generic include files.

Cc Geert Uytterhoeven <[email protected]>
Cc Roman Zippel <[email protected]>
---
 include/asm-m68k/types.h |   32 +-------------------------------
 1 files changed, 1 insertions(+), 31 deletions(-)
include/asm-m68k/types.h +1 -31
index c35c09d..6441cb5 100644
@@ -8,30 +8,12 @@
  * not a major issue.  However, for interoperability, libraries still
  * need to be careful to avoid a name clashes.
  */
+#include <asm-generic/int-ll64.h>
 
 #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__ */
 
 /*
@@ -43,18 +25,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 always 32-bits wide */
 
 typedef u32 dma_addr_t;
Signature · 1 line
1.5.4.1
#22 lore raw

PATCH 11/24 m68k: types: use <asm-generic/int-*.h> for the m68k architecture

This modifies <asm-m68k/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-m68k/types.h |   32 +-------------------------------
 1 files changed, 1 insertions(+), 31 deletions(-)
include/asm-m68k/types.h +1 -31
index c35c09d..6441cb5 100644
@@ -8,30 +8,12 @@
  * not a major issue.  However, for interoperability, libraries still
  * need to be careful to avoid a name clashes.
  */
+#include <asm-generic/int-ll64.h>
 
 #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__ */
 
 /*
@@ -43,18 +25,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 always 32-bits wide */
 
 typedef u32 dma_addr_t;
Signature · 1 line
1.5.4.1
#23 lore raw

PATCH 12/24 mips: types: use <asm-generic/int-*.h> for the mips architecture

This modifies <asm-mips/types.h> to use the <asm-generic/int-*.h> generic include files.

Cc Ralf Baechle <ralf-6z/[email protected]>
---
 include/asm-mips/types.h |   56 +++++-----------------------------------------
 1 files changed, 6 insertions(+), 50 deletions(-)
include/asm-mips/types.h +6 -50
index 2dd147f..7a2ee4f 100644
@@ -9,36 +9,16 @@
 #ifndef _ASM_TYPES_H
 #define _ASM_TYPES_H
 
+#if _MIPS_SZLONG == 64
+# include <asm-generic/int-l64.h>
+#else
+# include <asm-generic/int-ll64.h>
+#endif
+
 #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 (_MIPS_SZLONG == 64)
-
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-
-#else
-
-#if defined(__GNUC__)
-__extension__ typedef __signed__ long long __s64;
-__extension__ typedef unsigned long long __u64;
-#endif
-
 #endif
 
 #endif /* __ASSEMBLY__ */
@@ -52,30 +32,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;
-
-#if (_MIPS_SZLONG == 64)
-
-typedef __signed__ long s64;
-typedef unsigned long u64;
-
-#else
-
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long s64;
-typedef unsigned long long u64;
-#endif
-
-#endif
-
 #if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \
     || defined(CONFIG_64BIT)
 typedef u64 dma_addr_t;
Signature · 1 line
1.5.4.1
#24 lore raw

PATCH 12/24 mips: types: use <asm-generic/int-*.h> for the mips architecture

This modifies <asm-mips/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-mips/types.h |   56 +++++-----------------------------------------
 1 files changed, 6 insertions(+), 50 deletions(-)
include/asm-mips/types.h +6 -50
index 2dd147f..7a2ee4f 100644
@@ -9,36 +9,16 @@
 #ifndef _ASM_TYPES_H
 #define _ASM_TYPES_H
 
+#if _MIPS_SZLONG == 64
+# include <asm-generic/int-l64.h>
+#else
+# include <asm-generic/int-ll64.h>
+#endif
+
 #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 (_MIPS_SZLONG == 64)
-
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-
-#else
-
-#if defined(__GNUC__)
-__extension__ typedef __signed__ long long __s64;
-__extension__ typedef unsigned long long __u64;
-#endif
-
 #endif
 
 #endif /* __ASSEMBLY__ */
@@ -52,30 +32,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;
-
-#if (_MIPS_SZLONG == 64)
-
-typedef __signed__ long s64;
-typedef unsigned long u64;
-
-#else
-
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long s64;
-typedef unsigned long long u64;
-#endif
-
-#endif
-
 #if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \
     || defined(CONFIG_64BIT)
 typedef u64 dma_addr_t;
Signature · 1 line
1.5.4.1
#25 lore raw

PATCH 13/24 mn10300: types: use <asm-generic/int-*.h> for the mn10300 architecture

This modifies <asm-mn10300/types.h> to use the <asm-generic/int-*.h> generic include files.

Cc David Howells <[email protected]>
Cc Koichi Yasutake <[email protected]>
---
 include/asm-mn10300/types.h |   33 ++-------------------------------
 1 files changed, 2 insertions(+), 31 deletions(-)
include/asm-mn10300/types.h +2 -31
index d40ea76..7b9f010 100644
@@ -11,29 +11,12 @@
 #ifndef _ASM_TYPES_H
 #define _ASM_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
-#endif
-
 #endif /* __ASSEMBLY__ */
 
 /*
@@ -45,18 +28,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;
-
 /* Dma addresses are 32-bits wide.  */
 typedef u32 dma_addr_t;
 
Signature · 1 line
1.5.4.1
#26 lore raw

PATCH 13/24 mn10300: types: use <asm-generic/int-*.h> for the mn10300 architecture

This modifies <asm-mn10300/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-mn10300/types.h |   33 ++-------------------------------
 1 files changed, 2 insertions(+), 31 deletions(-)
include/asm-mn10300/types.h +2 -31
index d40ea76..7b9f010 100644
@@ -11,29 +11,12 @@
 #ifndef _ASM_TYPES_H
 #define _ASM_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
-#endif
-
 #endif /* __ASSEMBLY__ */
 
 /*
@@ -45,18 +28,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;
-
 /* Dma addresses are 32-bits wide.  */
 typedef u32 dma_addr_t;
 
Signature · 1 line
1.5.4.1
#27 lore raw

PATCH 14/24 parisc: types: use <asm-generic/int-*.h> for the parisc architecture

This modifies <asm-parisc/types.h> to use the <asm-generic/int-*.h> generic include files.

Cc Kyle McMartin <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Grant Grundler <[email protected]>
---
 include/asm-parisc/types.h |   33 ++-------------------------------
 1 files changed, 2 insertions(+), 31 deletions(-)
include/asm-parisc/types.h +2 -31
index 56c8480..7f5a39b 100644
@@ -1,29 +1,12 @@
 #ifndef _PARISC_TYPES_H
 #define _PARISC_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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__ */
 
 /*
@@ -41,18 +24,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;
Signature · 1 line
1.5.4.1
#28 lore raw

PATCH 14/24 parisc: types: use <asm-generic/int-*.h> for the parisc architecture

This modifies <asm-parisc/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-parisc/types.h |   33 ++-------------------------------
 1 files changed, 2 insertions(+), 31 deletions(-)
include/asm-parisc/types.h +2 -31
index 56c8480..7f5a39b 100644
@@ -1,29 +1,12 @@
 #ifndef _PARISC_TYPES_H
 #define _PARISC_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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__ */
 
 /*
@@ -41,18 +24,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;
Signature · 1 line
1.5.4.1
#29 lore raw

PATCH 15/24 powerpc: types: use <asm-generic/int-*.h> for the powerpc architecture

This modifies <asm-powerpc/types.h> to use the <asm-generic/int-*.h> generic include files.

Cc Paul Mackerras <[email protected]>
Cc Anton Blanchard <[email protected]>
---
 include/asm-powerpc/types.h |   48 +++++-------------------------------------
 1 files changed, 6 insertions(+), 42 deletions(-)
include/asm-powerpc/types.h +6 -42
index c243a6a..d3374bc 100644
@@ -1,6 +1,12 @@
 #ifndef _ASM_POWERPC_TYPES_H
 #define _ASM_POWERPC_TYPES_H
 
+#ifdef __powerpc64__
+# include <asm-generic/int-l64.h>
+#else
+# include <asm-generic/int-ll64.h>
+#endif
+
 #ifndef __ASSEMBLY__
 
 /*
@@ -22,30 +28,6 @@ typedef unsigned int umode_t;
 typedef unsigned short umode_t;
 #endif
 
-/*
- * __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 __powerpc64__
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-#else
-#if defined(__GNUC__)
-__extension__ typedef __signed__ long long __s64;
-__extension__ typedef unsigned long long __u64;
-#endif
-#endif /* __powerpc64__ */
-
 typedef struct {
 	__u32 u[4];
 } __attribute__((aligned(16))) __vector128;
@@ -64,24 +46,6 @@ typedef struct {
 
 #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;
-
-#ifdef __powerpc64__
-typedef signed long s64;
-typedef unsigned long u64;
-#else
-typedef signed long long s64;
-typedef unsigned long long u64;
-#endif
-
 typedef __vector128 vector128;
 
 /* Physical address used by some IO functions */
Signature · 1 line
1.5.4.1
#30 lore raw

PATCH 15/24 powerpc: types: use <asm-generic/int-*.h> for the powerpc architecture

This modifies <asm-powerpc/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-powerpc/types.h |   48 +++++-------------------------------------
 1 files changed, 6 insertions(+), 42 deletions(-)
include/asm-powerpc/types.h +6 -42
index c243a6a..d3374bc 100644
@@ -1,6 +1,12 @@
 #ifndef _ASM_POWERPC_TYPES_H
 #define _ASM_POWERPC_TYPES_H
 
+#ifdef __powerpc64__
+# include <asm-generic/int-l64.h>
+#else
+# include <asm-generic/int-ll64.h>
+#endif
+
 #ifndef __ASSEMBLY__
 
 /*
@@ -22,30 +28,6 @@ typedef unsigned int umode_t;
 typedef unsigned short umode_t;
 #endif
 
-/*
- * __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 __powerpc64__
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-#else
-#if defined(__GNUC__)
-__extension__ typedef __signed__ long long __s64;
-__extension__ typedef unsigned long long __u64;
-#endif
-#endif /* __powerpc64__ */
-
 typedef struct {
 	__u32 u[4];
 } __attribute__((aligned(16))) __vector128;
@@ -64,24 +46,6 @@ typedef struct {
 
 #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;
-
-#ifdef __powerpc64__
-typedef signed long s64;
-typedef unsigned long u64;
-#else
-typedef signed long long s64;
-typedef unsigned long long u64;
-#endif
-
 typedef __vector128 vector128;
 
 /* Physical address used by some IO functions */
Signature · 1 line
1.5.4.1
#31 lore raw

PATCH 16/24 s390: types: use <asm-generic/int-*.h> for the s390 architecture

This modifies <asm-s390/types.h> to use the <asm-generic/int-*.h> generic include files.

Cc Martin Schwidefsky <[email protected]>
Cc Heiko Carstens <[email protected]>
---
 include/asm-s390/types.h |   48 +++++----------------------------------------
 1 files changed, 6 insertions(+), 42 deletions(-)
include/asm-s390/types.h +6 -42
index 2c5879a..78dda03 100644
@@ -9,34 +9,16 @@
 #ifndef _S390_TYPES_H
 #define _S390_TYPES_H
 
+#ifndef __s390x__
+# include <asm-generic/int-l64.h>
+#else
+# include <asm-generic/int-ll64.h>
+#endif
+
 #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;
-
-#ifndef __s390x__
-#if defined(__GNUC__)
-__extension__ typedef __signed__ long long __s64;
-__extension__ typedef unsigned long long __u64;
-#endif
-#else /* __s390x__ */
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-#endif
-
 /* A address type so that arithmetic can be done on it & it can be upgraded to
    64 bit when necessary 
 */
@@ -58,24 +40,6 @@ typedef __signed__ long saddr_t;
 
 #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;
-
-#ifndef __s390x__
-typedef signed long long s64;
-typedef unsigned long long u64;
-#else /* __s390x__ */
-typedef signed long s64;
-typedef unsigned  long u64;
-#endif /* __s390x__ */
-
 typedef u32 dma_addr_t;
 
 #ifndef __s390x__
Signature · 1 line
1.5.4.1
#32 lore raw

PATCH 16/24 s390: types: use <asm-generic/int-*.h> for the s390 architecture

This modifies <asm-s390/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-s390/types.h |   48 +++++----------------------------------------
 1 files changed, 6 insertions(+), 42 deletions(-)
include/asm-s390/types.h +6 -42
index 2c5879a..78dda03 100644
@@ -9,34 +9,16 @@
 #ifndef _S390_TYPES_H
 #define _S390_TYPES_H
 
+#ifndef __s390x__
+# include <asm-generic/int-l64.h>
+#else
+# include <asm-generic/int-ll64.h>
+#endif
+
 #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;
-
-#ifndef __s390x__
-#if defined(__GNUC__)
-__extension__ typedef __signed__ long long __s64;
-__extension__ typedef unsigned long long __u64;
-#endif
-#else /* __s390x__ */
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-#endif
-
 /* A address type so that arithmetic can be done on it & it can be upgraded to
    64 bit when necessary 
 */
@@ -58,24 +40,6 @@ typedef __signed__ long saddr_t;
 
 #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;
-
-#ifndef __s390x__
-typedef signed long long s64;
-typedef unsigned long long u64;
-#else /* __s390x__ */
-typedef signed long s64;
-typedef unsigned  long u64;
-#endif /* __s390x__ */
-
 typedef u32 dma_addr_t;
 
 #ifndef __s390x__
Signature · 1 line
1.5.4.1
#33 lore raw

PATCH 17/24 sh: types: use <asm-generic/int-*.h> for the sh architecture

This modifies <asm-sh/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-sh/types.h |   34 ++--------------------------------
 1 files changed, 2 insertions(+), 32 deletions(-)
include/asm-sh/types.h +2 -32
index a6e1d41..beea4e6 100644
@@ -1,29 +1,12 @@
 #ifndef __ASM_SH_TYPES_H
 #define __ASM_SH_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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;
Signature · 1 line
1.5.4.1
#34 lore raw

PATCH 17/24 sh: types: use <asm-generic/int-*.h> for the sh architecture

This modifies <asm-sh/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-sh/types.h |   34 ++--------------------------------
 1 files changed, 2 insertions(+), 32 deletions(-)
include/asm-sh/types.h +2 -32
index a6e1d41..beea4e6 100644
@@ -1,29 +1,12 @@
 #ifndef __ASM_SH_TYPES_H
 #define __ASM_SH_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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;
Signature · 1 line
1.5.4.1
#35 lore raw

PATCH 18/24 sparc: types: use <asm-generic/int-*.h> for the sparc architecture

This modifies <asm-sparc/types.h> to use the <asm-generic/int-*.h> generic include files.

Cc William L. Irwin <[email protected]>
---
 include/asm-sparc/types.h |   30 +-----------------------------
 1 files changed, 1 insertions(+), 29 deletions(-)
include/asm-sparc/types.h +1 -29
index 42fc6ed..1b08ef8 100644
@@ -3,34 +3,18 @@
 #define _SPARC_TYPES_H
 
 /*
- * _xx is ok: it doesn't pollute the POSIX namespace. Use these in the
- * header files exported to user space.
- */
-
-/*
  * This file is never included by application software unless
  * explicitly requested (e.g., via linux/types.h) in which case the
  * application is Linux specific so (user-) name space pollution is
  * not a major issue.  However, for interoperability, libraries still
  * need to be careful to avoid a name clashes.
  */
+#include <asm-generic/int-ll64.h>
 
 #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;
-
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
-
 #endif /* __ASSEMBLY__ */
 
 #ifdef __KERNEL__
@@ -39,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;
-
 typedef u32 dma_addr_t;
 typedef u32 dma64_addr_t;
 
Signature · 1 line
1.5.4.1
#36 lore raw

PATCH 18/24 sparc: types: use <asm-generic/int-*.h> for the sparc architecture

This modifies <asm-sparc/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-sparc/types.h |   30 +-----------------------------
 1 files changed, 1 insertions(+), 29 deletions(-)
include/asm-sparc/types.h +1 -29
index 42fc6ed..1b08ef8 100644
@@ -3,34 +3,18 @@
 #define _SPARC_TYPES_H
 
 /*
- * _xx is ok: it doesn't pollute the POSIX namespace. Use these in the
- * header files exported to user space.
- */
-
-/*
  * This file is never included by application software unless
  * explicitly requested (e.g., via linux/types.h) in which case the
  * application is Linux specific so (user-) name space pollution is
  * not a major issue.  However, for interoperability, libraries still
  * need to be careful to avoid a name clashes.
  */
+#include <asm-generic/int-ll64.h>
 
 #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;
-
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
-
 #endif /* __ASSEMBLY__ */
 
 #ifdef __KERNEL__
@@ -39,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;
-
 typedef u32 dma_addr_t;
 typedef u32 dma64_addr_t;
 
Signature · 1 line
1.5.4.1
#37 lore raw

PATCH 19/24 sparc64: types: use <asm-generic/int-*.h> for the sparc64 architecture

This modifies <asm-sparc64/types.h> to use the <asm-generic/int-*.h> generic include files.

Cc David S. Miller <davem-fT/PcQaiUtIeIZ0/[email protected]>
---
 include/asm-sparc64/types.h |   30 +-----------------------------
 1 files changed, 1 insertions(+), 29 deletions(-)
include/asm-sparc64/types.h +1 -29
index d0ee7f1..5dbe04f 100644
@@ -9,28 +9,12 @@
  * not a major issue.  However, for interoperability, libraries still
  * need to be careful to avoid a name clashes.
  */
+#include <asm-generic/int-l64.h>
 
 #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;
-
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-
 #endif /* __ASSEMBLY__ */
 
 #ifdef __KERNEL__
@@ -39,18 +23,6 @@ typedef unsigned 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 s64;
-typedef unsigned long u64;
-
 /* Dma addresses come in generic and 64-bit flavours.  */
 
 typedef u32 dma_addr_t;
Signature · 1 line
1.5.4.1
#38 lore raw

PATCH 19/24 sparc64: types: use <asm-generic/int-*.h> for the sparc64 architecture

This modifies <asm-sparc64/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-sparc64/types.h |   30 +-----------------------------
 1 files changed, 1 insertions(+), 29 deletions(-)
include/asm-sparc64/types.h +1 -29
index d0ee7f1..5dbe04f 100644
@@ -9,28 +9,12 @@
  * not a major issue.  However, for interoperability, libraries still
  * need to be careful to avoid a name clashes.
  */
+#include <asm-generic/int-l64.h>
 
 #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;
-
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-
 #endif /* __ASSEMBLY__ */
 
 #ifdef __KERNEL__
@@ -39,18 +23,6 @@ typedef unsigned 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 s64;
-typedef unsigned long u64;
-
 /* Dma addresses come in generic and 64-bit flavours.  */
 
 typedef u32 dma_addr_t;
Signature · 1 line
1.5.4.1
#39 lore raw

PATCH 20/24 v850: types: use <asm-generic/int-*.h> for the v850 architecture

This modifies <asm-v850/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-v850/types.h |   32 +-------------------------------
 1 files changed, 1 insertions(+), 31 deletions(-)
include/asm-v850/types.h +1 -31
index 284bda8..89f735e 100644
@@ -10,28 +10,10 @@
  * not a major issue.  However, for interoperability, libraries still
  * need to be careful to avoid a name clashes.
  */
+#include <asm-generic/int-ll64.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;
-
-#if defined(__GNUC__)
-__extension__ typedef __signed__ long long __s64;
-__extension__ typedef unsigned long long __u64;
-#endif
-
 #endif /* !__ASSEMBLY__ */
 
 /*
@@ -43,18 +25,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;
Signature · 1 line
1.5.4.1
#40 lore raw

PATCH 21/24 x86: types: use <asm-generic/int-*.h> for the x86 architecture

This modifies <asm-x86/types.h> to use the <asm-generic/int-*.h> generic include files.

Cc H. Peter Anvin <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/asm-x86/types.h |   38 ++------------------------------------
 1 files changed, 2 insertions(+), 36 deletions(-)
include/asm-x86/types.h +2 -36
index 63733f3..1ac80cd 100644
@@ -1,34 +1,12 @@
 #ifndef _ASM_X86_TYPES_H
 #define _ASM_X86_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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;
-
-#ifdef __i386__
-# ifdef __GNUC__
-__extension__ typedef __signed__ long long __s64;
-__extension__ typedef unsigned long long __u64;
-# endif
-#else
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
-#endif
-
 #endif /* __ASSEMBLY__ */
 
 /*
@@ -44,18 +22,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;
-
 typedef u64 dma64_addr_t;
 #if defined(CONFIG_X86_64) || defined(CONFIG_HIGHMEM64G)
 /* DMA addresses come in 32-bit and 64-bit flavours. */
Signature · 1 line
1.5.4.1
#41 lore raw

PATCH 21/24 x86: types: use <asm-generic/int-*.h> for the x86 architecture

This modifies <asm-x86/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-x86/types.h |   38 ++------------------------------------
 1 files changed, 2 insertions(+), 36 deletions(-)
include/asm-x86/types.h +2 -36
index 63733f3..1ac80cd 100644
@@ -1,34 +1,12 @@
 #ifndef _ASM_X86_TYPES_H
 #define _ASM_X86_TYPES_H
 
+#include <asm-generic/int-ll64.h>
+
 #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;
-
-#ifdef __i386__
-# ifdef __GNUC__
-__extension__ typedef __signed__ long long __s64;
-__extension__ typedef unsigned long long __u64;
-# endif
-#else
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
-#endif
-
 #endif /* __ASSEMBLY__ */
 
 /*
@@ -44,18 +22,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;
-
 typedef u64 dma64_addr_t;
 #if defined(CONFIG_X86_64) || defined(CONFIG_HIGHMEM64G)
 /* DMA addresses come in 32-bit and 64-bit flavours. */
Signature · 1 line
1.5.4.1
#42 lore raw

PATCH 22/24 xtensa: types: use <asm-generic/int-*.h> for the xtensa architecture

This modifies <asm-xtensa/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-xtensa/types.h |   33 +--------------------------------
 1 files changed, 1 insertions(+), 32 deletions(-)
include/asm-xtensa/types.h +1 -32
index b27d841..c89569a 100644
@@ -11,6 +11,7 @@
 #ifndef _XTENSA_TYPES_H
 #define _XTENSA_TYPES_H
 
+#include <asm-generic/int-ll64.h>
 
 #ifdef __ASSEMBLY__
 # define __XTENSA_UL(x)		(x)
@@ -25,42 +26,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.  */
Signature · 1 line
1.5.4.1
#43 lore raw

PATCH 22/24 xtensa: types: use <asm-generic/int-*.h> for the xtensa architecture

This modifies <asm-xtensa/types.h> to use the <asm-generic/int-*.h> generic include files.

---
 include/asm-xtensa/types.h |   33 +--------------------------------
 1 files changed, 1 insertions(+), 32 deletions(-)
include/asm-xtensa/types.h +1 -32
index b27d841..c89569a 100644
@@ -11,6 +11,7 @@
 #ifndef _XTENSA_TYPES_H
 #define _XTENSA_TYPES_H
 
+#include <asm-generic/int-ll64.h>
 
 #ifdef __ASSEMBLY__
 # define __XTENSA_UL(x)		(x)
@@ -25,42 +26,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.  */
Signature · 1 line
1.5.4.1
#44 lore raw

PATCH 23/24 types: add C99-style constructors to <asm-generic/int-*.h>

Add C99-style constructor macros for fixed types to <asm-generic/int-*.h>. Since Linux uses names like "u64" instead of "uint64_t", the constructor macros are called U64_C() instead of UINT64_C() and so forth.

These macros allow specific sizes to be specified as U64_C(0x123456789abcdef), without gcc issuing warnings as it will if one writes (u64)0x123456789abcdef.

When used from assembly, these macros pass their argument unchanged.

---
 include/asm-generic/int-l64.h  |   20 ++++++++++++++++++++
 include/asm-generic/int-ll64.h |   20 ++++++++++++++++++++
 2 files changed, 40 insertions(+), 0 deletions(-)
include/asm-generic/int-l64.h +20 -0
index 629b5a4..2af9b75 100644
@@ -44,6 +44,26 @@ typedef unsigned int u32;
 typedef signed long s64;
 typedef unsigned long u64;
 
+#define S8_C(x)  x
+#define U8_C(x)  x ## U
+#define S16_C(x) x
+#define U16_C(x) x ## U
+#define S32_C(x) x
+#define U32_C(x) x ## U
+#define S64_C(x) x ## L
+#define U64_C(x) x ## UL
+
+#else /* __ASSEMBLY__ */
+
+#define S8_C(x)  x
+#define U8_C(x)  x
+#define S16_C(x) x
+#define U16_C(x) x
+#define S32_C(x) x
+#define U32_C(x) x
+#define S64_C(x) x
+#define U64_C(x) x
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
include/asm-generic/int-ll64.h +20 -0
index 1e5ffec..2609489 100644
@@ -49,6 +49,26 @@ typedef unsigned int u32;
 typedef signed long long s64;
 typedef unsigned long long u64;
 
+#define S8_C(x)  x
+#define U8_C(x)  x ## U
+#define S16_C(x) x
+#define U16_C(x) x ## U
+#define S32_C(x) x
+#define U32_C(x) x ## U
+#define S64_C(x) x ## LL
+#define U64_C(x) x ## ULL
+
+#else /* __ASSEMBLY__ */
+
+#define S8_C(x)  x
+#define U8_C(x)  x
+#define S16_C(x) x
+#define U16_C(x) x
+#define S32_C(x) x
+#define U32_C(x) x
+#define S64_C(x) x
+#define U64_C(x) x
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
Signature · 1 line
1.5.4.1
#45 lore raw

PATCH 24/24 Use U64_C() instead of casts in kernel/time.c

Use the new U64_C() constructor macro instead of using casts for constants in kernel/time.c. This avoids warnings with some gcc versions.

This resolves Bugzilla 10153.

---
 kernel/time.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
kernel/time.c +4 -4
index 35d373a..519822b 100644
@@ -244,7 +244,7 @@ unsigned int inline jiffies_to_msecs(const unsigned long j)
 	return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC);
 #else
 # if BITS_PER_LONG == 32
-	return ((u64)HZ_TO_MSEC_MUL32 * j) >> HZ_TO_MSEC_SHR32;
+	return (U64_C(HZ_TO_MSEC_MUL32) * j) >> HZ_TO_MSEC_SHR32;
 # else
 	return (j * HZ_TO_MSEC_NUM) / HZ_TO_MSEC_DEN;
 # endif
@@ -260,7 +260,7 @@ unsigned int inline jiffies_to_usecs(const unsigned long j)
 	return (j + (HZ / USEC_PER_SEC) - 1)/(HZ / USEC_PER_SEC);
 #else
 # if BITS_PER_LONG == 32
-	return ((u64)HZ_TO_USEC_MUL32 * j) >> HZ_TO_USEC_SHR32;
+	return (U64_C(HZ_TO_USEC_MUL32) * j) >> HZ_TO_USEC_SHR32;
 # else
 	return (j * HZ_TO_USEC_NUM) / HZ_TO_USEC_DEN;
 # endif
@@ -470,7 +470,7 @@ unsigned long msecs_to_jiffies(const unsigned int m)
 	if (HZ > MSEC_PER_SEC && m > jiffies_to_msecs(MAX_JIFFY_OFFSET))
 		return MAX_JIFFY_OFFSET;
 
-	return ((u64)MSEC_TO_HZ_MUL32 * m + MSEC_TO_HZ_ADJ32)
+	return (U64_C(MSEC_TO_HZ_MUL32) * m + MSEC_TO_HZ_ADJ32)
 		>> MSEC_TO_HZ_SHR32;
 #endif
 }
@@ -485,7 +485,7 @@ unsigned long usecs_to_jiffies(const unsigned int u)
 #elif HZ > USEC_PER_SEC && !(HZ % USEC_PER_SEC)
 	return u * (HZ / USEC_PER_SEC);
 #else
-	return ((u64)USEC_TO_HZ_MUL32 * u + USEC_TO_HZ_ADJ32)
+	return (U64_C(USEC_TO_HZ_MUL32) * u + USEC_TO_HZ_ADJ32)
 		>> USEC_TO_HZ_SHR32;
 #endif
 }
Signature · 1 line
1.5.4.1
Acked-by on v1 3/24
#52 lore raw

Re: [PATCH 03/24] arm: types: use <asm-generic/int-*.h> for the arm architecture

In reply to H. Peter Anvin
Quoted 7 lines · H. Peter Anvin

This modifies <asm-arm/types.h> to use the <asm-generic/int-*.h> generic include files.

Cc Russell King <rmk-lFZ/[email protected]>
Cc Lennert Buytenhek <kernel-OLH4Qvv75CYX/[email protected]>
Cc Ben Dooks <[email protected]>
#48 lore raw

RE: [PATCH 09/24] ia64: types: use <asm-generic/int-*.h> for the ia64 architecture

In reply to H. Peter Anvin

I get an error while building the ia64 sim_defconfig (which uses CONFIG_HZ=32)

kernel/time.c: In function `msecs_to_jiffies':
kernel/time.c:472: error: `MSEC_TO_HZ_MUL32UL' undeclared (first use in this function) kernel/time.c:472: error: (Each undeclared identifier is reported only once kernel/time.c:472: error: for each function it appears in.)

The generated timeconst.h has:
#define MSEC_TO_HZ_MUL32 0x83126e98

So some weird cpp thing happened and the UL got concatenated before the MSEC_TO_HZ_MUL32 was swapped out for its defined value.

All the rest of the ia64 configs build ok.

-Tony

#49 lore raw

Re: [PATCH 09/24] ia64: types: use <asm-generic/int-*.h> for the ia64 architecture

Quoted 9 lines · Tony

I get an error while building the ia64 sim_defconfig (which uses CONFIG_HZ=32)

kernel/time.c: In function `msecs_to_jiffies':
kernel/time.c:472: error: `MSEC_TO_HZ_MUL32UL' undeclared (first use in this function) kernel/time.c:472: error: (Each undeclared identifier is reported only once kernel/time.c:472: error: for each function it appears in.)

Quoted 9 lines

The generated timeconst.h has:
#define MSEC_TO_HZ_MUL32 0x83126e98

So some weird cpp thing happened and the UL got concatenated before the MSEC_TO_HZ_MUL32 was swapped out for its defined value.

All the rest of the ia64 configs build ok.

OK... I'm clearly having a bad day... not only is the last patch in the series (the kernel/time.c stuff) just plain broken, but I ran the wrong test battery on it.

I will fix it up and post a replacement patch.

-hpa

#50 lore raw

PATCH 24/24 Use U64_C() instead of casts in kernel/time.c

In reply to Luck, Tony

Use the new U64_C() constructor macro instead of using casts for constants in kernel/time.c. This avoids warnings with some gcc versions.

Note that since pasting has priority over macro resolution, the header file generation is modified to have suffixed versions of all the generated values.

This resolves Bugzilla 10153.

---
 kernel/time.c       |    8 ++++----
 kernel/timeconst.pl |   21 ++++++++++++++++-----
 2 files changed, 20 insertions(+), 9 deletions(-)

This is the corrected version of this patch. My apologies. The git repository has also been corrected:

git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-inttypes.git

kernel/time.c +4 -4
index 35d373a..652fd4f 100644
@@ -244,7 +244,7 @@ unsigned int inline jiffies_to_msecs(const unsigned long j)
 	return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC);
 #else
 # if BITS_PER_LONG == 32
-	return ((u64)HZ_TO_MSEC_MUL32 * j) >> HZ_TO_MSEC_SHR32;
+	return (U64_C(HZ_TO_MSEC_MUL32) * j) >> HZ_TO_MSEC_SHR32;
 # else
 	return (j * HZ_TO_MSEC_NUM) / HZ_TO_MSEC_DEN;
 # endif
@@ -260,7 +260,7 @@ unsigned int inline jiffies_to_usecs(const unsigned long j)
 	return (j + (HZ / USEC_PER_SEC) - 1)/(HZ / USEC_PER_SEC);
 #else
 # if BITS_PER_LONG == 32
-	return ((u64)HZ_TO_USEC_MUL32 * j) >> HZ_TO_USEC_SHR32;
+	return (U64_C(HZ_TO_USEC_MUL32) * j) >> HZ_TO_USEC_SHR32;
 # else
 	return (j * HZ_TO_USEC_NUM) / HZ_TO_USEC_DEN;
 # endif
@@ -470,7 +470,7 @@ unsigned long msecs_to_jiffies(const unsigned int m)
 	if (HZ > MSEC_PER_SEC && m > jiffies_to_msecs(MAX_JIFFY_OFFSET))
 		return MAX_JIFFY_OFFSET;
 
-	return ((u64)MSEC_TO_HZ_MUL32 * m + MSEC_TO_HZ_ADJ32)
+	return (U64_C(MSEC_TO_HZ_MUL32) * m + U64_C(MSEC_TO_HZ_ADJ32))
 		>> MSEC_TO_HZ_SHR32;
 #endif
 }
@@ -485,7 +485,7 @@ unsigned long usecs_to_jiffies(const unsigned int u)
 #elif HZ > USEC_PER_SEC && !(HZ % USEC_PER_SEC)
 	return u * (HZ / USEC_PER_SEC);
 #else
-	return ((u64)USEC_TO_HZ_MUL32 * u + USEC_TO_HZ_ADJ32)
+	return (U64_C(USEC_TO_HZ_MUL32) * u + U64_C(USEC_TO_HZ_ADJ32))
 		>> USEC_TO_HZ_SHR32;
 #endif
 }
kernel/timeconst.pl +16 -5
index 4146803..6212498 100644
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # -----------------------------------------------------------------------
 #
-#   Copyright 2007 rPath, Inc. - All Rights Reserved
+#   Copyright 2007-2008 rPath, Inc. - All Rights Reserved
 #
 #   This file is part of the Linux kernel, and is made available under
 #   the terms of the GNU General Public License version 2 or (at your
@@ -318,6 +318,19 @@ sub compute_values($) {
 	return @val;
 }
 
+# Create defines for a value, including variants with all appropriate
+# suffixes.  The suffixed versions also allow pasted constructs like
+# U64_C(HZ_TO_MSEC_MUL32) to work correctly.
+sub outputval($$)
+{
+	my($name, $val) = @_;
+	my $csuf;
+
+	foreach $csuf ('', 'U', 'L', 'UL', 'LL', 'ULL') {
+		printf "#define %-23s %s\n", $name.$csuf, $val.$csuf;
+	}
+}
+
 sub output($@)
 {
 	my($hz, @val) = @_;
@@ -342,13 +355,11 @@ sub output($@)
 		      'HZ_TO_USEC','USEC_TO_HZ') {
 		foreach $bit (32, 64) {
 			foreach $suf ('MUL', 'ADJ', 'SHR') {
-				printf "#define %-23s %s\n",
-					"${pfx}_$suf$bit", shift(@val);
+				outputval("${pfx}_$suf$bit", shift(@val));
 			}
 		}
 		foreach $suf ('NUM', 'DEN') {
-			printf "#define %-23s %s\n",
-				"${pfx}_$suf", shift(@val);
+			outputval("${pfx}_$suf", shift(@val));
 		}
 	}
 
Signature · 1 line
1.5.4.1
Acked-by on v1 24/24
#51 lore raw

RE: [PATCH 24/24] Use U64_C() instead of casts in kernel/time.c

Quoted 3 lines

Note that since pasting has priority over macro resolution, the header file generation is modified to have suffixed versions of all the generated values.

Much better. Builds and boots on ia64 now. I only ran some trivial tests, but it still seems to be counting time correctly.

#67 lore raw
In reply to H. Peter Anvin
Quoted 4 lines · H. Peter Anvin

This patchset unifies the integer definitions across all the <asm-*/types.h> files, replacing them with two asm-generic files, one for the LL64 model (all 32-bit architectures plus x86-64) and one for the L64 model (all other 64-bit architectures.)

Just a minor nitpick, what about calling them LP32 and LP64, like everybody else does?
I.e. asm-generic/types-lp{32,64}.h?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#68 lore raw
Quoted 8 lines · Geert Uytterhoeven
Quoted 4 lines · H. Peter Anvin

This patchset unifies the integer definitions across all the <asm-*/types.h> files, replacing them with two asm-generic files, one for the LL64 model (all 32-bit architectures plus x86-64) and one for the L64 model (all other 64-bit architectures.)

Just a minor nitpick, what about calling them LP32 and LP64, like everybody else does?

LP32 wouldn't fit x86-64 (the header has nothing to say about pointer types, it's all about integer types).

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
maintainer
#69 lore raw
In reply to H. Peter Anvin
Quoted 4 lines · H. Peter Anvin

This patchset unifies the integer definitions across all the <asm-*/types.h> files, replacing them with two asm-generic files, one for the LL64 model (all 32-bit architectures plus x86-64) and one for the L64 model (all other 64-bit architectures.)

I started hacking on a similar patch just yesterday, but with a slightly different goal. My intention was to move the headers in a direction where a new architecture (microblaze being the next one) would no longer have to care about ABI defining headers at all, but just use the defaults from a single #include line.

I could deal with x86 by leaving the current asm-x86/types.h in place, and change all the others so they can use the common one. The only difference here would be umode_t and dma_addr_t, which are irregularly defined on a few architectures, but we can assume reasonable defaults, as in

asm-powerpc/types.h:

#ifdef __powerpc64__
#define __umode_t unsigned int
#include <asm-generic/types_64.h>
#else
#include <asm-generic/types_32.h>
#endif

asm-generic/types_64.h:

#ifdef __umode_t
typedef __umode_t umode_t;
#else
typedef unsigned short umode_t;
#endif

	Arnd <><
#53 lore raw

Re: [PATCH 01/24] types: create <asm-generic/int-*.h>

In reply to H. Peter Anvin
Quoted 3 lines · H. Peter Anvin

This creates two generic files with common integer definitions; one where 64 bits is "long" (most 64-bit architectures) and one where 64 bits is "long long" (all 32-bit architectures and x86-64.)

long long is 64 bits on both 32 and 64, is not it? If so, the split between 32 and 64 should not be necessary.

#54 lore raw

Re: [PATCH 01/24] types: create <asm-generic/int-*.h>

Quoted 3 lines · Jan Engelhardt

long long is 64 bits on both 32 and 64, is not it? If so, the split between 32 and 64 should not be necessary.

They may be the same size, but there are still pure C-level _type_ differences that the compiler will warn about.

This is the same issue as a 32-bit type on x86-32: is it an "int" or a "long"? From a pure size perspective it shouldn't matter, but if you pass a pointer to it, or use it in a "printf()", it matters a whole lot, because the compiler will complain if you use the wrong version.

So on some 32-bit architectures, "size_t" is "unsigned int", on others it is "unsigned long", and you have to get it right in order to avoid complaints.

The exact same thing is true about "long" vs "long long" on 64-bit architectures. They may have the same size, but they don't have the same type.

Linus

#55 lore raw

Re: [PATCH 01/24] types: create <asm-generic/int-*.h>

Quoted 12 lines · Linus Torvalds
Quoted 2 lines · Jan Engelhardt

long long is 64 bits on both 32 and 64, is not it? If so, the split between 32 and 64 should not be necessary.

They may be the same size, but there are still pure C-level _type_ differences that the compiler will warn about.

This is the same issue as a 32-bit type on x86-32: is it an "int" or a "long"? From a pure size perspective it shouldn't matter, but if you pass a pointer to it, or use it in a "printf()", it matters a whole lot, because the compiler will complain if you use the wrong version.

Quoted 7 lines

So on some 32-bit architectures, "size_t" is "unsigned int", on others it is "unsigned long", and you have to get it right in order to avoid complaints.

The exact same thing is true about "long" vs "long long" on 64-bit architectures. They may have the same size, but they don't have the same type.

So ... given all this, why do we define s64 to be 'long' on some architectures and 'long long' on others? It seems to actively _hinder_ passing it to printf(), so there must be some other good reason that I'm missing to not make it 'long long' everywhere.

Signature · 4 lines
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
#56 lore raw

Re: [PATCH 01/24] types: create <asm-generic/int-*.h>

Quoted 3 lines · Matthew Wilcox

So ... given all this, why do we define s64 to be 'long' on some architectures and 'long long' on others?

Historical reasons, mainly. Once we start using one type for things like loff_t, it ends up getting encoded in user header files, and we're then basically forced to continue to use that particular type. Some of them end literally being embedded in the compiler itself (ie __builtin_size_t etc end up being known by compiler built-ins).

But yes, we could probably try to standardize the internal kernel s64/u64 types that don't end up spreading anywhere else.

Of course, part of the worry is probably that people thought that maybe "long long" would some day be 128-bit on a 64-bit architecture.

Linus

#57 lore raw

Re: [PATCH 01/24] types: create <asm-generic/int-*.h>

In reply to Matthew Wilcox
Quoted 6 lines · Matthew Wilcox

So ... given all this, why do we define s64 to be 'long' on some architectures and 'long long' on others? It seems to actively _hinder_ passing it to printf(), so there must be some other good reason that I'm missing to not make it 'long long' everywhere.

Well, compatibility with userspace is probably one aspect of that. x86-64 is the odd man out there, it defines __s64 as "long long" even for userspace, even though int64_t from <stdint.h> is "long". This, IMO, is the Wrong Thing, but it's a separate set of changes.

The right thing to do is probably to always use "long long" in the kernel, while defining __s64 et al as "long" on 64-bit platforms when not under __KERNEL__.

Again, this is a separate set of changes from this patchset, which is just a code transformation.

-hpa

#58 lore raw

Re: [PATCH 01/24] types: create <asm-generic/int-*.h>

Quoted 11 lines · H. Peter Anvin

Well, compatibility with userspace is probably one aspect of that. x86-64 is the odd man out there, it defines __s64 as "long long" even for userspace, even though int64_t from <stdint.h> is "long". This, IMO, is the Wrong Thing, but it's a separate set of changes.

The right thing to do is probably to always use "long long" in the kernel, while defining __s64 et al as "long" on 64-bit platforms when not under __KERNEL__.

Again, this is a separate set of changes from this patchset, which is just a code transformation.

Understood, and agreed. It just seemed like an opportune time to mention the problem of printing a u64.

Signature · 4 lines
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
#59 lore raw

Re: [PATCH 01/24] types: create <asm-generic/int-*.h>

Quoted 10 lines · Matthew Wilcox
Quoted 5 lines · H. Peter Anvin

Well, compatibility with userspace is probably one aspect of that. x86-64 is the odd man out there, it defines __s64 as "long long" even for userspace, even though int64_t from <stdint.h> is "long". This, IMO, is the Wrong Thing, but it's a separate set of changes.

The right thing to do is probably to always use "long long" in the kernel, while defining __s64 et al as "long" on 64-bit platforms when not under __KERNEL__.

Again, this is a separate set of changes from this patchset, which is just a code transformation.

Understood, and agreed. It just seemed like an opportune time to mention the problem of printing a u64.

I have to admit to liking the Windows extension %I64u for this kind of stuff. Unfortunately gcc/glibc decided to use I for internationalized digits instead :(

-hpa

#60 lore raw

Re: [PATCH 01/24] types: create <asm-generic/int-*.h>

Quoted 7 lines · H. Peter Anvin
Quoted 3 lines

Understood, and agreed. It just seemed like an opportune time to mention the problem of printing a u64.

I have to admit to liking the Windows extension %I64u for this kind of stuff. Unfortunately gcc/glibc decided to use I for internationalized digits instead :(

In the kernel's *printk, we are free to do what we want :)

%_64u perhaps?

#62 lore raw

Re: [PATCH 01/24] types: create <asm-generic/int-*.h>

In reply to H. Peter Anvin
Quoted 4 lines · H. Peter Anvin

I have to admit to liking the Windows extension %I64u for this kind of stuff. Unfortunately gcc/glibc decided to use I for internationalized digits instead :(

The sad part is that this is purely a gcc thing. We could easily do the right thing in the kernel vsnprintf stuff, but then we'd have to drop the nice format warnings from gcc ;(

Linus

#63 lore raw

Re: [PATCH 01/24] types: create <asm-generic/int-*.h>

Quoted 8 lines · Linus Torvalds
Quoted 3 lines · H. Peter Anvin

I have to admit to liking the Windows extension %I64u for this kind of stuff. Unfortunately gcc/glibc decided to use I for internationalized digits instead :(

The sad part is that this is purely a gcc thing. We could easily do the right thing in the kernel vsnprintf stuff, but then we'd have to drop the nice format warnings from gcc ;(

Yes, that's the fundamental problem.

There isn't even a flag for gcc to set this behaviour, with the result that any code compiled with MinGW (gcc for Win32) spews warnings like crazy.

-hpa

#64 lore raw

Re: [PATCH 01/24] types: create <asm-generic/int-*.h>

In reply to Linus Torvalds
Quoted 10 lines · Linus Torvalds
Quoted 4 lines · H. Peter Anvin

I have to admit to liking the Windows extension %I64u for this kind of stuff. Unfortunately gcc/glibc decided to use I for internationalized digits instead :(

The sad part is that this is purely a gcc thing. We could easily do the right thing in the kernel vsnprintf stuff, but then we'd have to drop the nice format warnings from gcc ;(

This looks like something sparse could be made to check though, should we lose the gcc checking.

In fact, didn't Al Viro mention adding just this kind of checking to sparse recently?

Harvey

#65 lore raw

Re: [PATCH 01/24] types: create <asm-generic/int-*.h>

In reply to Jan Engelhardt

From: Jan Engelhardt <[email protected]>
Date: Fri, 25 Apr 2008 20:27:53 +0200 (CEST)

Quoted 8 lines · H. Peter Anvin
Quoted 4 lines

This creates two generic files with common integer definitions; one where 64 bits is "long" (most 64-bit architectures) and one where 64 bits is "long long" (all 32-bit architectures and x86-64.)

long long is 64 bits on both 32 and 64, is not it? If so, the split between 32 and 64 should not be necessary.

Because of the large precendence, if you change this stuff, you're going to get tons of warnings on the platforms that use "unsigned long" currently if you change them to use "unsigned long long".

Think about all of the implicit type conversions, argument passing, et al.

I know because I tried to convert sparc64 over to "unsigned long long" to make it more like powerpc, and I found quickly that fixing up all the fallout simply was not worth it.

#70 lore raw
In reply to Arnd Bergmann
Quoted 12 lines · Arnd Bergmann
Quoted 4 lines · H. Peter Anvin

This patchset unifies the integer definitions across all the <asm-*/types.h> files, replacing them with two asm-generic files, one for the LL64 model (all 32-bit architectures plus x86-64) and one for the L64 model (all other 64-bit architectures.)

I started hacking on a similar patch just yesterday, but with a slightly different goal. My intention was to move the headers in a direction where a new architecture (microblaze being the next one) would no longer have to care about ABI defining headers at all, but just use the defaults from a single #include line.

Quoted 5 lines

I could deal with x86 by leaving the current asm-x86/types.h in place, and change all the others so they can use the common one. The only difference here would be umode_t and dma_addr_t, which are irregularly defined on a few architectures, but we can assume reasonable defaults, as in

It seems reasonable to implement what you are proposing on top of my changes, IMO.

-hpa

#61 lore raw

Re: [PATCH 01/24] types: create <asm-generic/int-*.h>

In reply to Jan Engelhardt
Quoted 1 line · Jan Engelhardt

In the kernel's *printk, we are free to do what we want :)

Subject to -Wformat in gcc, of course...

David