aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/asm-alpha/types.h36
-rw-r--r--include/asm-arm/types.h33
-rw-r--r--include/asm-avr32/types.h32
-rw-r--r--include/asm-blackfin/types.h34
-rw-r--r--include/asm-cris/types.h33
-rw-r--r--include/asm-frv/types.h34
-rw-r--r--include/asm-generic/Kbuild2
-rw-r--r--include/asm-generic/int-l64.h71
-rw-r--r--include/asm-generic/int-ll64.h76
-rw-r--r--include/asm-h8300/types.h33
-rw-r--r--include/asm-ia64/types.h31
-rw-r--r--include/asm-m32r/types.h32
-rw-r--r--include/asm-m68k/types.h32
-rw-r--r--include/asm-mips/types.h56
-rw-r--r--include/asm-mn10300/types.h33
-rw-r--r--include/asm-parisc/types.h33
-rw-r--r--include/asm-powerpc/types.h48
-rw-r--r--include/asm-s390/types.h48
-rw-r--r--include/asm-sh/types.h34
-rw-r--r--include/asm-sparc/types.h30
-rw-r--r--include/asm-sparc64/types.h30
-rw-r--r--include/asm-v850/types.h32
-rw-r--r--include/asm-x86/types.h38
-rw-r--r--include/asm-xtensa/types.h33
-rw-r--r--kernel/time.c8
-rw-r--r--kernel/timeconst.pl120
26 files changed, 249 insertions, 773 deletions
diff --git a/include/asm-alpha/types.h b/include/asm-alpha/types.h
index f5716139ec89..a9e34ca4d463 100644
--- a/include/asm-alpha/types.h
+++ b/include/asm-alpha/types.h
@@ -8,28 +8,12 @@
8 * not a major issue. However, for interoperability, libraries still 8 * not a major issue. However, for interoperability, libraries still
9 * need to be careful to avoid a name clashes. 9 * need to be careful to avoid a name clashes.
10 */ 10 */
11#include <asm-generic/int-l64.h>
11 12
12#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
13 14
14typedef unsigned int umode_t; 15typedef unsigned int umode_t;
15 16
16/*
17 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
18 * header files exported to user space
19 */
20
21typedef __signed__ char __s8;
22typedef unsigned char __u8;
23
24typedef __signed__ short __s16;
25typedef unsigned short __u16;
26
27typedef __signed__ int __s32;
28typedef unsigned int __u32;
29
30typedef __signed__ long __s64;
31typedef unsigned long __u64;
32
33#endif /* __ASSEMBLY__ */ 17#endif /* __ASSEMBLY__ */
34 18
35/* 19/*
@@ -39,23 +23,5 @@ typedef unsigned long __u64;
39 23
40#define BITS_PER_LONG 64 24#define BITS_PER_LONG 64
41 25
42#ifndef __ASSEMBLY__
43
44typedef signed char s8;
45typedef unsigned char u8;
46
47typedef signed short s16;
48typedef unsigned short u16;
49
50typedef signed int s32;
51typedef unsigned int u32;
52
53typedef signed long s64;
54typedef unsigned long u64;
55
56typedef u64 dma_addr_t;
57typedef u64 dma64_addr_t;
58
59#endif /* __ASSEMBLY__ */
60#endif /* __KERNEL__ */ 26#endif /* __KERNEL__ */
61#endif /* _ALPHA_TYPES_H */ 27#endif /* _ALPHA_TYPES_H */
diff --git a/include/asm-arm/types.h b/include/asm-arm/types.h
index 3141451a9bd6..345df01534a4 100644
--- a/include/asm-arm/types.h
+++ b/include/asm-arm/types.h
@@ -1,29 +1,12 @@
1#ifndef __ASM_ARM_TYPES_H 1#ifndef __ASM_ARM_TYPES_H
2#define __ASM_ARM_TYPES_H 2#define __ASM_ARM_TYPES_H
3 3
4#include <asm-generic/int-ll64.h>
5
4#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
5 7
6typedef unsigned short umode_t; 8typedef unsigned short umode_t;
7 9
8/*
9 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
10 * header files exported to user space
11 */
12
13typedef __signed__ char __s8;
14typedef unsigned char __u8;
15
16typedef __signed__ short __s16;
17typedef unsigned short __u16;
18
19typedef __signed__ int __s32;
20typedef unsigned int __u32;
21
22#if defined(__GNUC__)
23__extension__ typedef __signed__ long long __s64;
24__extension__ typedef unsigned long long __u64;
25#endif
26
27#endif /* __ASSEMBLY__ */ 10#endif /* __ASSEMBLY__ */
28 11
29/* 12/*
@@ -35,18 +18,6 @@ __extension__ typedef unsigned long long __u64;
35 18
36#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
37 20
38typedef signed char s8;
39typedef unsigned char u8;
40
41typedef signed short s16;
42typedef unsigned short u16;
43
44typedef signed int s32;
45typedef unsigned int u32;
46
47typedef signed long long s64;
48typedef unsigned long long u64;
49
50/* Dma addresses are 32-bits wide. */ 21/* Dma addresses are 32-bits wide. */
51 22
52typedef u32 dma_addr_t; 23typedef u32 dma_addr_t;
diff --git a/include/asm-avr32/types.h b/include/asm-avr32/types.h
index 8999a3819403..9cefda6f534a 100644
--- a/include/asm-avr32/types.h
+++ b/include/asm-avr32/types.h
@@ -8,28 +8,12 @@
8#ifndef __ASM_AVR32_TYPES_H 8#ifndef __ASM_AVR32_TYPES_H
9#define __ASM_AVR32_TYPES_H 9#define __ASM_AVR32_TYPES_H
10 10
11#include <asm-generic/int-ll64.h>
12
11#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
12 14
13typedef unsigned short umode_t; 15typedef unsigned short umode_t;
14 16
15/*
16 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
17 * header files exported to user space
18 */
19typedef __signed__ char __s8;
20typedef unsigned char __u8;
21
22typedef __signed__ short __s16;
23typedef unsigned short __u16;
24
25typedef __signed__ int __s32;
26typedef unsigned int __u32;
27
28#if defined(__GNUC__)
29__extension__ typedef __signed__ long long __s64;
30__extension__ typedef unsigned long long __u64;
31#endif
32
33#endif /* __ASSEMBLY__ */ 17#endif /* __ASSEMBLY__ */
34 18
35/* 19/*
@@ -41,18 +25,6 @@ __extension__ typedef unsigned long long __u64;
41 25
42#ifndef __ASSEMBLY__ 26#ifndef __ASSEMBLY__
43 27
44typedef signed char s8;
45typedef unsigned char u8;
46
47typedef signed short s16;
48typedef unsigned short u16;
49
50typedef signed int s32;
51typedef unsigned int u32;
52
53typedef signed long long s64;
54typedef unsigned long long u64;
55
56/* Dma addresses are 32-bits wide. */ 28/* Dma addresses are 32-bits wide. */
57 29
58typedef u32 dma_addr_t; 30typedef u32 dma_addr_t;
diff --git a/include/asm-blackfin/types.h b/include/asm-blackfin/types.h
index 9785a6d531c6..8441cbc2bf9e 100644
--- a/include/asm-blackfin/types.h
+++ b/include/asm-blackfin/types.h
@@ -8,30 +8,12 @@
8 * not a major issue. However, for interoperability, libraries still 8 * not a major issue. However, for interoperability, libraries still
9 * need to be careful to avoid a name clashes. 9 * need to be careful to avoid a name clashes.
10 */ 10 */
11#include <asm-generic/int-ll64.h>
12
11#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
12 14
13typedef unsigned short umode_t; 15typedef unsigned short umode_t;
14 16
15/*
16 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
17 * header files exported to user space
18 */
19
20typedef __signed__ char __s8;
21typedef unsigned char __u8;
22
23typedef __signed__ short __s16;
24typedef unsigned short __u16;
25
26typedef __signed__ int __s32;
27typedef unsigned int __u32;
28
29/* HK0617 -- Changes to unsigned long temporarily */
30#if defined(__GNUC__)
31__extension__ typedef __signed__ long long __s64;
32__extension__ typedef unsigned long long __u64;
33#endif
34
35#endif /* __ASSEMBLY__ */ 17#endif /* __ASSEMBLY__ */
36/* 18/*
37 * These aren't exported outside the kernel to avoid name space clashes 19 * These aren't exported outside the kernel to avoid name space clashes
@@ -42,18 +24,6 @@ __extension__ typedef unsigned long long __u64;
42 24
43#ifndef __ASSEMBLY__ 25#ifndef __ASSEMBLY__
44 26
45typedef signed char s8;
46typedef unsigned char u8;
47
48typedef signed short s16;
49typedef unsigned short u16;
50
51typedef signed int s32;
52typedef unsigned int u32;
53
54typedef signed long long s64;
55typedef unsigned long long u64;
56
57/* Dma addresses are 32-bits wide. */ 27/* Dma addresses are 32-bits wide. */
58 28
59typedef u32 dma_addr_t; 29typedef u32 dma_addr_t;
diff --git a/include/asm-cris/types.h b/include/asm-cris/types.h
index 5a21c42bc6c5..5790262cbe8a 100644
--- a/include/asm-cris/types.h
+++ b/include/asm-cris/types.h
@@ -1,29 +1,12 @@
1#ifndef _ETRAX_TYPES_H 1#ifndef _ETRAX_TYPES_H
2#define _ETRAX_TYPES_H 2#define _ETRAX_TYPES_H
3 3
4#include <asm-generic/int-ll64.h>
5
4#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
5 7
6typedef unsigned short umode_t; 8typedef unsigned short umode_t;
7 9
8/*
9 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
10 * header files exported to user space
11 */
12
13typedef __signed__ char __s8;
14typedef unsigned char __u8;
15
16typedef __signed__ short __s16;
17typedef unsigned short __u16;
18
19typedef __signed__ int __s32;
20typedef unsigned int __u32;
21
22#if defined(__GNUC__)
23__extension__ typedef __signed__ long long __s64;
24__extension__ typedef unsigned long long __u64;
25#endif
26
27#endif /* __ASSEMBLY__ */ 10#endif /* __ASSEMBLY__ */
28 11
29/* 12/*
@@ -35,18 +18,6 @@ __extension__ typedef unsigned long long __u64;
35 18
36#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
37 20
38typedef signed char s8;
39typedef unsigned char u8;
40
41typedef signed short s16;
42typedef unsigned short u16;
43
44typedef signed int s32;
45typedef unsigned int u32;
46
47typedef signed long long s64;
48typedef unsigned long long u64;
49
50/* Dma addresses are 32-bits wide, just like our other addresses. */ 21/* Dma addresses are 32-bits wide, just like our other addresses. */
51 22
52typedef u32 dma_addr_t; 23typedef u32 dma_addr_t;
diff --git a/include/asm-frv/types.h b/include/asm-frv/types.h
index 767e5ed71c4b..613bf1e962f0 100644
--- a/include/asm-frv/types.h
+++ b/include/asm-frv/types.h
@@ -12,29 +12,12 @@
12#ifndef _ASM_TYPES_H 12#ifndef _ASM_TYPES_H
13#define _ASM_TYPES_H 13#define _ASM_TYPES_H
14 14
15#include <asm-generic/int-ll64.h>
16
15#ifndef __ASSEMBLY__ 17#ifndef __ASSEMBLY__
16 18
17typedef unsigned short umode_t; 19typedef unsigned short umode_t;
18 20
19/*
20 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
21 * header files exported to user space
22 */
23
24typedef __signed__ char __s8;
25typedef unsigned char __u8;
26
27typedef __signed__ short __s16;
28typedef unsigned short __u16;
29
30typedef __signed__ int __s32;
31typedef unsigned int __u32;
32
33#if defined(__GNUC__)
34__extension__ typedef __signed__ long long __s64;
35__extension__ typedef unsigned long long __u64;
36#endif
37
38#endif /* __ASSEMBLY__ */ 21#endif /* __ASSEMBLY__ */
39 22
40/* 23/*
@@ -46,19 +29,6 @@ __extension__ typedef unsigned long long __u64;
46 29
47#ifndef __ASSEMBLY__ 30#ifndef __ASSEMBLY__
48 31
49
50typedef signed char s8;
51typedef unsigned char u8;
52
53typedef signed short s16;
54typedef unsigned short u16;
55
56typedef signed int s32;
57typedef unsigned int u32;
58
59typedef signed long long s64;
60typedef unsigned long long u64;
61
62/* Dma addresses are 32-bits wide. */ 32/* Dma addresses are 32-bits wide. */
63 33
64typedef u32 dma_addr_t; 34typedef u32 dma_addr_t;
diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild
index c18110ee30f1..4c9932a2503f 100644
--- a/include/asm-generic/Kbuild
+++ b/include/asm-generic/Kbuild
@@ -7,5 +7,7 @@ header-y += poll.h
7header-y += signal.h 7header-y += signal.h
8header-y += statfs.h 8header-y += statfs.h
9 9
10unifdef-y += int-l64.h
11unifdef-y += int-ll64.h
10unifdef-y += resource.h 12unifdef-y += resource.h
11unifdef-y += siginfo.h 13unifdef-y += siginfo.h
diff --git a/include/asm-generic/int-l64.h b/include/asm-generic/int-l64.h
new file mode 100644
index 000000000000..2af9b75d77db
--- /dev/null
+++ b/include/asm-generic/int-l64.h
@@ -0,0 +1,71 @@
1/*
2 * asm-generic/int-l64.h
3 *
4 * Integer declarations for architectures which use "long"
5 * for 64-bit types.
6 */
7
8#ifndef _ASM_GENERIC_INT_L64_H
9#define _ASM_GENERIC_INT_L64_H
10
11#ifndef __ASSEMBLY__
12/*
13 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
14 * header files exported to user space
15 */
16
17typedef __signed__ char __s8;
18typedef unsigned char __u8;
19
20typedef __signed__ short __s16;
21typedef unsigned short __u16;
22
23typedef __signed__ int __s32;
24typedef unsigned int __u32;
25
26typedef __signed__ long __s64;
27typedef unsigned long __u64;
28
29#endif /* __ASSEMBLY__ */
30
31#ifdef __KERNEL__
32
33#ifndef __ASSEMBLY__
34
35typedef signed char s8;
36typedef unsigned char u8;
37
38typedef signed short s16;
39typedef unsigned short u16;
40
41typedef signed int s32;
42typedef unsigned int u32;
43
44typedef signed long s64;
45typedef unsigned long u64;
46
47#define S8_C(x) x
48#define U8_C(x) x ## U
49#define S16_C(x) x
50#define U16_C(x) x ## U
51#define S32_C(x) x
52#define U32_C(x) x ## U
53#define S64_C(x) x ## L
54#define U64_C(x) x ## UL
55
56#else /* __ASSEMBLY__ */
57
58#define S8_C(x) x
59#define U8_C(x) x
60#define S16_C(x) x
61#define U16_C(x) x
62#define S32_C(x) x
63#define U32_C(x) x
64#define S64_C(x) x
65#define U64_C(x) x
66
67#endif /* __ASSEMBLY__ */
68
69#endif /* __KERNEL__ */
70
71#endif /* _ASM_GENERIC_INT_L64_H */
diff --git a/include/asm-generic/int-ll64.h b/include/asm-generic/int-ll64.h
new file mode 100644
index 000000000000..260948905e4e
--- /dev/null
+++ b/include/asm-generic/int-ll64.h
@@ -0,0 +1,76 @@
1/*
2 * asm-generic/int-ll64.h
3 *
4 * Integer declarations for architectures which use "long long"
5 * for 64-bit types.
6 */
7
8#ifndef _ASM_GENERIC_INT_LL64_H
9#define _ASM_GENERIC_INT_LL64_H
10
11#ifndef __ASSEMBLY__
12/*
13 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
14 * header files exported to user space
15 */
16
17typedef __signed__ char __s8;
18typedef unsigned char __u8;
19
20typedef __signed__ short __s16;
21typedef unsigned short __u16;
22
23typedef __signed__ int __s32;
24typedef unsigned int __u32;
25
26#ifdef __GNUC__
27__extension__ typedef __signed__ long long __s64;
28__extension__ typedef unsigned long long __u64;
29#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
30typedef __signed__ long long __s64;
31typedef unsigned long long __u64;
32#endif
33
34#endif /* __ASSEMBLY__ */
35
36#ifdef __KERNEL__
37
38#ifndef __ASSEMBLY__
39
40typedef signed char s8;
41typedef unsigned char u8;
42
43typedef signed short s16;
44typedef unsigned short u16;
45
46typedef signed int s32;
47typedef unsigned int u32;
48
49typedef signed long long s64;
50typedef unsigned long long u64;
51
52#define S8_C(x) x
53#define U8_C(x) x ## U
54#define S16_C(x) x
55#define U16_C(x) x ## U
56#define S32_C(x) x
57#define U32_C(x) x ## U
58#define S64_C(x) x ## LL
59#define U64_C(x) x ## ULL
60
61#else /* __ASSEMBLY__ */
62
63#define S8_C(x) x
64#define U8_C(x) x
65#define S16_C(x) x
66#define U16_C(x) x
67#define S32_C(x) x
68#define U32_C(x) x
69#define S64_C(x) x
70#define U64_C(x) x
71
72#endif /* __ASSEMBLY__ */
73
74#endif /* __KERNEL__ */
75
76#endif /* _ASM_GENERIC_INT_LL64_H */
diff --git a/include/asm-h8300/types.h b/include/asm-h8300/types.h
index 56566e2a09fd..12875190b156 100644
--- a/include/asm-h8300/types.h
+++ b/include/asm-h8300/types.h
@@ -1,6 +1,8 @@
1#ifndef _H8300_TYPES_H 1#ifndef _H8300_TYPES_H
2#define _H8300_TYPES_H 2#define _H8300_TYPES_H
3 3
4#include <asm-generic/int-ll64.h>
5
4#if !defined(__ASSEMBLY__) 6#if !defined(__ASSEMBLY__)
5 7
6/* 8/*
@@ -14,41 +16,10 @@
14typedef unsigned short umode_t; 16typedef unsigned short umode_t;
15 17
16/* 18/*
17 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
18 * header files exported to user space
19 */
20
21typedef __signed__ char __s8;
22typedef unsigned char __u8;
23
24typedef __signed__ short __s16;
25typedef unsigned short __u16;
26
27typedef __signed__ int __s32;
28typedef unsigned int __u32;
29
30#if defined(__GNUC__)
31__extension__ typedef __signed__ long long __s64;
32__extension__ typedef unsigned long long __u64;
33#endif
34
35/*
36 * These aren't exported outside the kernel to avoid name space clashes 19 * These aren't exported outside the kernel to avoid name space clashes
37 */ 20 */
38#ifdef __KERNEL__ 21#ifdef __KERNEL__
39 22
40typedef signed char s8;
41typedef unsigned char u8;
42
43typedef signed short s16;
44typedef unsigned short u16;
45
46typedef signed int s32;
47typedef unsigned int u32;
48
49typedef signed long long s64;
50typedef unsigned long long u64;
51
52#define BITS_PER_LONG 32 23#define BITS_PER_LONG 32
53 24
54/* Dma addresses are 32-bits wide. */ 25/* Dma addresses are 32-bits wide. */
diff --git a/include/asm-ia64/types.h b/include/asm-ia64/types.h
index 902850d12424..e36b3716e718 100644
--- a/include/asm-ia64/types.h
+++ b/include/asm-ia64/types.h
@@ -13,6 +13,8 @@
13 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co 13 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
14 */ 14 */
15 15
16#include <asm-generic/int-l64.h>
17
16#ifdef __ASSEMBLY__ 18#ifdef __ASSEMBLY__
17# define __IA64_UL(x) (x) 19# define __IA64_UL(x) (x)
18# define __IA64_UL_CONST(x) x 20# define __IA64_UL_CONST(x) x
@@ -28,39 +30,10 @@
28typedef unsigned int umode_t; 30typedef unsigned int umode_t;
29 31
30/* 32/*
31 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
32 * header files exported to user space
33 */
34
35typedef __signed__ char __s8;
36typedef unsigned char __u8;
37
38typedef __signed__ short __s16;
39typedef unsigned short __u16;
40
41typedef __signed__ int __s32;
42typedef unsigned int __u32;
43
44typedef __signed__ long __s64;
45typedef unsigned long __u64;
46
47/*
48 * These aren't exported outside the kernel to avoid name space clashes 33 * These aren't exported outside the kernel to avoid name space clashes
49 */ 34 */
50# ifdef __KERNEL__ 35# ifdef __KERNEL__
51 36
52typedef __s8 s8;
53typedef __u8 u8;
54
55typedef __s16 s16;
56typedef __u16 u16;
57
58typedef __s32 s32;
59typedef __u32 u32;
60
61typedef __s64 s64;
62typedef __u64 u64;
63
64#define BITS_PER_LONG 64 37#define BITS_PER_LONG 64
65 38
66/* DMA addresses are 64-bits wide, in general. */ 39/* DMA addresses are 64-bits wide, in general. */
diff --git a/include/asm-m32r/types.h b/include/asm-m32r/types.h
index b64c16639a7b..bc9f7fff0ac3 100644
--- a/include/asm-m32r/types.h
+++ b/include/asm-m32r/types.h
@@ -1,28 +1,12 @@
1#ifndef _ASM_M32R_TYPES_H 1#ifndef _ASM_M32R_TYPES_H
2#define _ASM_M32R_TYPES_H 2#define _ASM_M32R_TYPES_H
3 3
4#include <asm-generic/int-ll64.h>
5
4#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
5 7
6typedef unsigned short umode_t; 8typedef unsigned short umode_t;
7 9
8/*
9 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
10 * header files exported to user space
11 */
12
13typedef __signed__ char __s8;
14typedef unsigned char __u8;
15
16typedef __signed__ short __s16;
17typedef unsigned short __u16;
18
19typedef __signed__ int __s32;
20typedef unsigned int __u32;
21
22#if defined(__GNUC__)
23__extension__ typedef __signed__ long long __s64;
24__extension__ typedef unsigned long long __u64;
25#endif
26#endif /* __ASSEMBLY__ */ 10#endif /* __ASSEMBLY__ */
27 11
28/* 12/*
@@ -34,18 +18,6 @@ __extension__ typedef unsigned long long __u64;
34 18
35#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
36 20
37typedef signed char s8;
38typedef unsigned char u8;
39
40typedef signed short s16;
41typedef unsigned short u16;
42
43typedef signed int s32;
44typedef unsigned int u32;
45
46typedef signed long long s64;
47typedef unsigned long long u64;
48
49/* DMA addresses are 32-bits wide. */ 21/* DMA addresses are 32-bits wide. */
50 22
51typedef u32 dma_addr_t; 23typedef u32 dma_addr_t;
diff --git a/include/asm-m68k/types.h b/include/asm-m68k/types.h
index c35c09d93b66..6441cb5f8e7c 100644
--- a/include/asm-m68k/types.h
+++ b/include/asm-m68k/types.h
@@ -8,30 +8,12 @@
8 * not a major issue. However, for interoperability, libraries still 8 * not a major issue. However, for interoperability, libraries still
9 * need to be careful to avoid a name clashes. 9 * need to be careful to avoid a name clashes.
10 */ 10 */
11#include <asm-generic/int-ll64.h>
11 12
12#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
13 14
14typedef unsigned short umode_t; 15typedef unsigned short umode_t;
15 16
16/*
17 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
18 * header files exported to user space
19 */
20
21typedef __signed__ char __s8;
22typedef unsigned char __u8;
23
24typedef __signed__ short __s16;
25typedef unsigned short __u16;
26
27typedef __signed__ int __s32;
28typedef unsigned int __u32;
29
30#if defined(__GNUC__)
31__extension__ typedef __signed__ long long __s64;
32__extension__ typedef unsigned long long __u64;
33#endif
34
35#endif /* __ASSEMBLY__ */ 17#endif /* __ASSEMBLY__ */
36 18
37/* 19/*
@@ -43,18 +25,6 @@ __extension__ typedef unsigned long long __u64;
43 25
44#ifndef __ASSEMBLY__ 26#ifndef __ASSEMBLY__
45 27
46typedef signed char s8;
47typedef unsigned char u8;
48
49typedef signed short s16;
50typedef unsigned short u16;
51
52typedef signed int s32;
53typedef unsigned int u32;
54
55typedef signed long long s64;
56typedef unsigned long long u64;
57
58/* DMA addresses are always 32-bits wide */ 28/* DMA addresses are always 32-bits wide */
59 29
60typedef u32 dma_addr_t; 30typedef u32 dma_addr_t;
diff --git a/include/asm-mips/types.h b/include/asm-mips/types.h
index 2dd147f519d1..7a2ee4f40131 100644
--- a/include/asm-mips/types.h
+++ b/include/asm-mips/types.h
@@ -9,36 +9,16 @@
9#ifndef _ASM_TYPES_H 9#ifndef _ASM_TYPES_H
10#define _ASM_TYPES_H 10#define _ASM_TYPES_H
11 11
12#if _MIPS_SZLONG == 64
13# include <asm-generic/int-l64.h>
14#else
15# include <asm-generic/int-ll64.h>
16#endif
17
12#ifndef __ASSEMBLY__ 18#ifndef __ASSEMBLY__
13 19
14typedef unsigned short umode_t; 20typedef unsigned short umode_t;
15 21
16/*
17 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
18 * header files exported to user space
19 */
20
21typedef __signed__ char __s8;
22typedef unsigned char __u8;
23
24typedef __signed__ short __s16;
25typedef unsigned short __u16;
26
27typedef __signed__ int __s32;
28typedef unsigned int __u32;
29
30#if (_MIPS_SZLONG == 64)
31
32typedef __signed__ long __s64;
33typedef unsigned long __u64;
34
35#else
36
37#if defined(__GNUC__)
38__extension__ typedef __signed__ long long __s64;
39__extension__ typedef unsigned long long __u64;
40#endif
41
42#endif 22#endif
43 23
44#endif /* __ASSEMBLY__ */ 24#endif /* __ASSEMBLY__ */
@@ -52,30 +32,6 @@ __extension__ typedef unsigned long long __u64;
52 32
53#ifndef __ASSEMBLY__ 33#ifndef __ASSEMBLY__
54 34
55
56typedef __signed char s8;
57typedef unsigned char u8;
58
59typedef __signed short s16;
60typedef unsigned short u16;
61
62typedef __signed int s32;
63typedef unsigned int u32;
64
65#if (_MIPS_SZLONG == 64)
66
67typedef __signed__ long s64;
68typedef unsigned long u64;
69
70#else
71
72#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
73typedef __signed__ long long s64;
74typedef unsigned long long u64;
75#endif
76
77#endif
78
79#if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \ 35#if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \
80 || defined(CONFIG_64BIT) 36 || defined(CONFIG_64BIT)
81typedef u64 dma_addr_t; 37typedef u64 dma_addr_t;
diff --git a/include/asm-mn10300/types.h b/include/asm-mn10300/types.h
index d40ea7628bfc..7b9f01042fd4 100644
--- a/include/asm-mn10300/types.h
+++ b/include/asm-mn10300/types.h
@@ -11,29 +11,12 @@
11#ifndef _ASM_TYPES_H 11#ifndef _ASM_TYPES_H
12#define _ASM_TYPES_H 12#define _ASM_TYPES_H
13 13
14#include <asm-generic/int-ll64.h>
15
14#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
15 17
16typedef unsigned short umode_t; 18typedef unsigned short umode_t;
17 19
18/*
19 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
20 * header files exported to user space
21 */
22
23typedef __signed__ char __s8;
24typedef unsigned char __u8;
25
26typedef __signed__ short __s16;
27typedef unsigned short __u16;
28
29typedef __signed__ int __s32;
30typedef unsigned int __u32;
31
32#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
33typedef __signed__ long long __s64;
34typedef unsigned long long __u64;
35#endif
36
37#endif /* __ASSEMBLY__ */ 20#endif /* __ASSEMBLY__ */
38 21
39/* 22/*
@@ -45,18 +28,6 @@ typedef unsigned long long __u64;
45 28
46#ifndef __ASSEMBLY__ 29#ifndef __ASSEMBLY__
47 30
48typedef signed char s8;
49typedef unsigned char u8;
50
51typedef signed short s16;
52typedef unsigned short u16;
53
54typedef signed int s32;
55typedef unsigned int u32;
56
57typedef signed long long s64;
58typedef unsigned long long u64;
59
60/* Dma addresses are 32-bits wide. */ 31/* Dma addresses are 32-bits wide. */
61typedef u32 dma_addr_t; 32typedef u32 dma_addr_t;
62 33
diff --git a/include/asm-parisc/types.h b/include/asm-parisc/types.h
index 56c84802da59..7f5a39bfb4ce 100644
--- a/include/asm-parisc/types.h
+++ b/include/asm-parisc/types.h
@@ -1,29 +1,12 @@
1#ifndef _PARISC_TYPES_H 1#ifndef _PARISC_TYPES_H
2#define _PARISC_TYPES_H 2#define _PARISC_TYPES_H
3 3
4#include <asm-generic/int-ll64.h>
5
4#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
5 7
6typedef unsigned short umode_t; 8typedef unsigned short umode_t;
7 9
8/*
9 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
10 * header files exported to user space
11 */
12
13typedef __signed__ char __s8;
14typedef unsigned char __u8;
15
16typedef __signed__ short __s16;
17typedef unsigned short __u16;
18
19typedef __signed__ int __s32;
20typedef unsigned int __u32;
21
22#if defined(__GNUC__)
23__extension__ typedef __signed__ long long __s64;
24__extension__ typedef unsigned long long __u64;
25#endif
26
27#endif /* __ASSEMBLY__ */ 10#endif /* __ASSEMBLY__ */
28 11
29/* 12/*
@@ -41,18 +24,6 @@ __extension__ typedef unsigned long long __u64;
41 24
42#ifndef __ASSEMBLY__ 25#ifndef __ASSEMBLY__
43 26
44typedef signed char s8;
45typedef unsigned char u8;
46
47typedef signed short s16;
48typedef unsigned short u16;
49
50typedef signed int s32;
51typedef unsigned int u32;
52
53typedef signed long long s64;
54typedef unsigned long long u64;
55
56/* Dma addresses are 32-bits wide. */ 27/* Dma addresses are 32-bits wide. */
57 28
58typedef u32 dma_addr_t; 29typedef u32 dma_addr_t;
diff --git a/include/asm-powerpc/types.h b/include/asm-powerpc/types.h
index c243a6ac60e5..d3374bc865ba 100644
--- a/include/asm-powerpc/types.h
+++ b/include/asm-powerpc/types.h
@@ -1,6 +1,12 @@
1#ifndef _ASM_POWERPC_TYPES_H 1#ifndef _ASM_POWERPC_TYPES_H
2#define _ASM_POWERPC_TYPES_H 2#define _ASM_POWERPC_TYPES_H
3 3
4#ifdef __powerpc64__
5# include <asm-generic/int-l64.h>
6#else
7# include <asm-generic/int-ll64.h>
8#endif
9
4#ifndef __ASSEMBLY__ 10#ifndef __ASSEMBLY__
5 11
6/* 12/*
@@ -22,30 +28,6 @@ typedef unsigned int umode_t;
22typedef unsigned short umode_t; 28typedef unsigned short umode_t;
23#endif 29#endif
24 30
25/*
26 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
27 * header files exported to user space
28 */
29
30typedef __signed__ char __s8;
31typedef unsigned char __u8;
32
33typedef __signed__ short __s16;
34typedef unsigned short __u16;
35
36typedef __signed__ int __s32;
37typedef unsigned int __u32;
38
39#ifdef __powerpc64__
40typedef __signed__ long __s64;
41typedef unsigned long __u64;
42#else
43#if defined(__GNUC__)
44__extension__ typedef __signed__ long long __s64;
45__extension__ typedef unsigned long long __u64;
46#endif
47#endif /* __powerpc64__ */
48
49typedef struct { 31typedef struct {
50 __u32 u[4]; 32 __u32 u[4];
51} __attribute__((aligned(16))) __vector128; 33} __attribute__((aligned(16))) __vector128;
@@ -64,24 +46,6 @@ typedef struct {
64 46
65#ifndef __ASSEMBLY__ 47#ifndef __ASSEMBLY__
66 48
67
68typedef signed char s8;
69typedef unsigned char u8;
70
71typedef signed short s16;
72typedef unsigned short u16;
73
74typedef signed int s32;
75typedef unsigned int u32;
76
77#ifdef __powerpc64__
78typedef signed long s64;
79typedef unsigned long u64;
80#else
81typedef signed long long s64;
82typedef unsigned long long u64;
83#endif
84
85typedef __vector128 vector128; 49typedef __vector128 vector128;
86 50
87/* Physical address used by some IO functions */ 51/* Physical address used by some IO functions */
diff --git a/include/asm-s390/types.h b/include/asm-s390/types.h
index 2c5879ae90ca..78dda038dd47 100644
--- a/include/asm-s390/types.h
+++ b/include/asm-s390/types.h
@@ -9,34 +9,16 @@
9#ifndef _S390_TYPES_H 9#ifndef _S390_TYPES_H
10#define _S390_TYPES_H 10#define _S390_TYPES_H
11 11
12#ifndef __s390x__
13# include <asm-generic/int-l64.h>
14#else
15# include <asm-generic/int-ll64.h>
16#endif
17
12#ifndef __ASSEMBLY__ 18#ifndef __ASSEMBLY__
13 19
14typedef unsigned short umode_t; 20typedef unsigned short umode_t;
15 21
16/*
17 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
18 * header files exported to user space
19 */
20
21typedef __signed__ char __s8;
22typedef unsigned char __u8;
23
24typedef __signed__ short __s16;
25typedef unsigned short __u16;
26
27typedef __signed__ int __s32;
28typedef unsigned int __u32;
29
30#ifndef __s390x__
31#if defined(__GNUC__)
32__extension__ typedef __signed__ long long __s64;
33__extension__ typedef unsigned long long __u64;
34#endif
35#else /* __s390x__ */
36typedef __signed__ long __s64;
37typedef unsigned long __u64;
38#endif
39
40/* A address type so that arithmetic can be done on it & it can be upgraded to 22/* A address type so that arithmetic can be done on it & it can be upgraded to
41 64 bit when necessary 23 64 bit when necessary
42*/ 24*/
@@ -58,24 +40,6 @@ typedef __signed__ long saddr_t;
58 40
59#ifndef __ASSEMBLY__ 41#ifndef __ASSEMBLY__
60 42
61
62typedef signed char s8;
63typedef unsigned char u8;
64
65typedef signed short s16;
66typedef unsigned short u16;
67
68typedef signed int s32;
69typedef unsigned int u32;
70
71#ifndef __s390x__
72typedef signed long long s64;
73typedef unsigned long long u64;
74#else /* __s390x__ */
75typedef signed long s64;
76typedef unsigned long u64;
77#endif /* __s390x__ */
78
79typedef u32 dma_addr_t; 43typedef u32 dma_addr_t;
80 44
81#ifndef __s390x__ 45#ifndef __s390x__
diff --git a/include/asm-sh/types.h b/include/asm-sh/types.h
index a6e1d4126e67..beea4e6f8dfd 100644
--- a/include/asm-sh/types.h
+++ b/include/asm-sh/types.h
@@ -1,29 +1,12 @@
1#ifndef __ASM_SH_TYPES_H 1#ifndef __ASM_SH_TYPES_H
2#define __ASM_SH_TYPES_H 2#define __ASM_SH_TYPES_H
3 3
4#include <asm-generic/int-ll64.h>
5
4#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
5 7
6typedef unsigned short umode_t; 8typedef unsigned short umode_t;
7 9
8/*
9 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
10 * header files exported to user space
11 */
12
13typedef __signed__ char __s8;
14typedef unsigned char __u8;
15
16typedef __signed__ short __s16;
17typedef unsigned short __u16;
18
19typedef __signed__ int __s32;
20typedef unsigned int __u32;
21
22#if defined(__GNUC__)
23__extension__ typedef __signed__ long long __s64;
24__extension__ typedef unsigned long long __u64;
25#endif
26
27#endif /* __ASSEMBLY__ */ 10#endif /* __ASSEMBLY__ */
28 11
29/* 12/*
@@ -35,19 +18,6 @@ __extension__ typedef unsigned long long __u64;
35 18
36#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
37 20
38
39typedef __signed__ char s8;
40typedef unsigned char u8;
41
42typedef __signed__ short s16;
43typedef unsigned short u16;
44
45typedef __signed__ int s32;
46typedef unsigned int u32;
47
48typedef __signed__ long long s64;
49typedef unsigned long long u64;
50
51/* Dma addresses are 32-bits wide. */ 21/* Dma addresses are 32-bits wide. */
52 22
53typedef u32 dma_addr_t; 23typedef u32 dma_addr_t;
diff --git a/include/asm-sparc/types.h b/include/asm-sparc/types.h
index 42fc6ed98156..1b08ef860a66 100644
--- a/include/asm-sparc/types.h
+++ b/include/asm-sparc/types.h
@@ -3,34 +3,18 @@
3#define _SPARC_TYPES_H 3#define _SPARC_TYPES_H
4 4
5/* 5/*
6 * _xx is ok: it doesn't pollute the POSIX namespace. Use these in the
7 * header files exported to user space.
8 */
9
10/*
11 * This file is never included by application software unless 6 * This file is never included by application software unless
12 * explicitly requested (e.g., via linux/types.h) in which case the 7 * explicitly requested (e.g., via linux/types.h) in which case the
13 * application is Linux specific so (user-) name space pollution is 8 * application is Linux specific so (user-) name space pollution is
14 * not a major issue. However, for interoperability, libraries still 9 * not a major issue. However, for interoperability, libraries still
15 * need to be careful to avoid a name clashes. 10 * need to be careful to avoid a name clashes.
16 */ 11 */
12#include <asm-generic/int-ll64.h>
17 13
18#ifndef __ASSEMBLY__ 14#ifndef __ASSEMBLY__
19 15
20typedef unsigned short umode_t; 16typedef unsigned short umode_t;
21 17
22typedef __signed__ char __s8;
23typedef unsigned char __u8;
24
25typedef __signed__ short __s16;
26typedef unsigned short __u16;
27
28typedef __signed__ int __s32;
29typedef unsigned int __u32;
30
31typedef __signed__ long long __s64;
32typedef unsigned long long __u64;
33
34#endif /* __ASSEMBLY__ */ 18#endif /* __ASSEMBLY__ */
35 19
36#ifdef __KERNEL__ 20#ifdef __KERNEL__
@@ -39,18 +23,6 @@ typedef unsigned long long __u64;
39 23
40#ifndef __ASSEMBLY__ 24#ifndef __ASSEMBLY__
41 25
42typedef __signed__ char s8;
43typedef unsigned char u8;
44
45typedef __signed__ short s16;
46typedef unsigned short u16;
47
48typedef __signed__ int s32;
49typedef unsigned int u32;
50
51typedef __signed__ long long s64;
52typedef unsigned long long u64;
53
54typedef u32 dma_addr_t; 26typedef u32 dma_addr_t;
55typedef u32 dma64_addr_t; 27typedef u32 dma64_addr_t;
56 28
diff --git a/include/asm-sparc64/types.h b/include/asm-sparc64/types.h
index d0ee7f105838..5dbe04f4044a 100644
--- a/include/asm-sparc64/types.h
+++ b/include/asm-sparc64/types.h
@@ -9,28 +9,12 @@
9 * not a major issue. However, for interoperability, libraries still 9 * not a major issue. However, for interoperability, libraries still
10 * need to be careful to avoid a name clashes. 10 * need to be careful to avoid a name clashes.
11 */ 11 */
12#include <asm-generic/int-l64.h>
12 13
13#ifndef __ASSEMBLY__ 14#ifndef __ASSEMBLY__
14 15
15typedef unsigned short umode_t; 16typedef unsigned short umode_t;
16 17
17/*
18 * _xx is ok: it doesn't pollute the POSIX namespace. Use these in the
19 * header files exported to user space.
20 */
21
22typedef __signed__ char __s8;
23typedef unsigned char __u8;
24
25typedef __signed__ short __s16;
26typedef unsigned short __u16;
27
28typedef __signed__ int __s32;
29typedef unsigned int __u32;
30
31typedef __signed__ long __s64;
32typedef unsigned long __u64;
33
34#endif /* __ASSEMBLY__ */ 18#endif /* __ASSEMBLY__ */
35 19
36#ifdef __KERNEL__ 20#ifdef __KERNEL__
@@ -39,18 +23,6 @@ typedef unsigned long __u64;
39 23
40#ifndef __ASSEMBLY__ 24#ifndef __ASSEMBLY__
41 25
42typedef __signed__ char s8;
43typedef unsigned char u8;
44
45typedef __signed__ short s16;
46typedef unsigned short u16;
47
48typedef __signed__ int s32;
49typedef unsigned int u32;
50
51typedef __signed__ long s64;
52typedef unsigned long u64;
53
54/* Dma addresses come in generic and 64-bit flavours. */ 26/* Dma addresses come in generic and 64-bit flavours. */
55 27
56typedef u32 dma_addr_t; 28typedef u32 dma_addr_t;
diff --git a/include/asm-v850/types.h b/include/asm-v850/types.h
index 284bda882112..89f735ee41dd 100644
--- a/include/asm-v850/types.h
+++ b/include/asm-v850/types.h
@@ -10,28 +10,10 @@
10 * not a major issue. However, for interoperability, libraries still 10 * not a major issue. However, for interoperability, libraries still
11 * need to be careful to avoid a name clashes. 11 * need to be careful to avoid a name clashes.
12 */ 12 */
13#include <asm-generic/int-ll64.h>
13 14
14typedef unsigned short umode_t; 15typedef unsigned short umode_t;
15 16
16/*
17 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
18 * header files exported to user space
19 */
20
21typedef __signed__ char __s8;
22typedef unsigned char __u8;
23
24typedef __signed__ short __s16;
25typedef unsigned short __u16;
26
27typedef __signed__ int __s32;
28typedef unsigned int __u32;
29
30#if defined(__GNUC__)
31__extension__ typedef __signed__ long long __s64;
32__extension__ typedef unsigned long long __u64;
33#endif
34
35#endif /* !__ASSEMBLY__ */ 17#endif /* !__ASSEMBLY__ */
36 18
37/* 19/*
@@ -43,18 +25,6 @@ __extension__ typedef unsigned long long __u64;
43 25
44#ifndef __ASSEMBLY__ 26#ifndef __ASSEMBLY__
45 27
46typedef signed char s8;
47typedef unsigned char u8;
48
49typedef signed short s16;
50typedef unsigned short u16;
51
52typedef signed int s32;
53typedef unsigned int u32;
54
55typedef signed long long s64;
56typedef unsigned long long u64;
57
58/* Dma addresses are 32-bits wide. */ 28/* Dma addresses are 32-bits wide. */
59 29
60typedef u32 dma_addr_t; 30typedef u32 dma_addr_t;
diff --git a/include/asm-x86/types.h b/include/asm-x86/types.h
index 63733f315688..1ac80cd9acf8 100644
--- a/include/asm-x86/types.h
+++ b/include/asm-x86/types.h
@@ -1,34 +1,12 @@
1#ifndef _ASM_X86_TYPES_H 1#ifndef _ASM_X86_TYPES_H
2#define _ASM_X86_TYPES_H 2#define _ASM_X86_TYPES_H
3 3
4#include <asm-generic/int-ll64.h>
5
4#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
5 7
6typedef unsigned short umode_t; 8typedef unsigned short umode_t;
7 9
8/*
9 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
10 * header files exported to user space
11 */
12
13typedef __signed__ char __s8;
14typedef unsigned char __u8;
15
16typedef __signed__ short __s16;
17typedef unsigned short __u16;
18
19typedef __signed__ int __s32;
20typedef unsigned int __u32;
21
22#ifdef __i386__
23# ifdef __GNUC__
24__extension__ typedef __signed__ long long __s64;
25__extension__ typedef unsigned long long __u64;
26# endif
27#else
28typedef __signed__ long long __s64;
29typedef unsigned long long __u64;
30#endif
31
32#endif /* __ASSEMBLY__ */ 10#endif /* __ASSEMBLY__ */
33 11
34/* 12/*
@@ -44,18 +22,6 @@ typedef unsigned long long __u64;
44 22
45#ifndef __ASSEMBLY__ 23#ifndef __ASSEMBLY__
46 24
47typedef signed char s8;
48typedef unsigned char u8;
49
50typedef signed short s16;
51typedef unsigned short u16;
52
53typedef signed int s32;
54typedef unsigned int u32;
55
56typedef signed long long s64;
57typedef unsigned long long u64;
58
59typedef u64 dma64_addr_t; 25typedef u64 dma64_addr_t;
60#if defined(CONFIG_X86_64) || defined(CONFIG_HIGHMEM64G) 26#if defined(CONFIG_X86_64) || defined(CONFIG_HIGHMEM64G)
61/* DMA addresses come in 32-bit and 64-bit flavours. */ 27/* DMA addresses come in 32-bit and 64-bit flavours. */
diff --git a/include/asm-xtensa/types.h b/include/asm-xtensa/types.h
index b27d841a8eb7..c89569a8da0c 100644
--- a/include/asm-xtensa/types.h
+++ b/include/asm-xtensa/types.h
@@ -11,6 +11,7 @@
11#ifndef _XTENSA_TYPES_H 11#ifndef _XTENSA_TYPES_H
12#define _XTENSA_TYPES_H 12#define _XTENSA_TYPES_H
13 13
14#include <asm-generic/int-ll64.h>
14 15
15#ifdef __ASSEMBLY__ 16#ifdef __ASSEMBLY__
16# define __XTENSA_UL(x) (x) 17# define __XTENSA_UL(x) (x)
@@ -25,42 +26,10 @@
25typedef unsigned short umode_t; 26typedef unsigned short umode_t;
26 27
27/* 28/*
28 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
29 * header files exported to user space
30 */
31
32typedef __signed__ char __s8;
33typedef unsigned char __u8;
34
35typedef __signed__ short __s16;
36typedef unsigned short __u16;
37
38typedef __signed__ int __s32;
39typedef unsigned int __u32;
40
41#if defined(__GNUC__)
42__extension__ typedef __signed__ long long __s64;
43__extension__ typedef unsigned long long __u64;
44#endif
45
46/*
47 * These aren't exported outside the kernel to avoid name space clashes 29 * These aren't exported outside the kernel to avoid name space clashes
48 */ 30 */
49#ifdef __KERNEL__ 31#ifdef __KERNEL__
50 32
51typedef __signed__ char s8;
52typedef unsigned char u8;
53
54typedef __signed__ short s16;
55typedef unsigned short u16;
56
57typedef __signed__ int s32;
58typedef unsigned int u32;
59
60typedef __signed__ long long s64;
61typedef unsigned long long u64;
62
63
64#define BITS_PER_LONG 32 33#define BITS_PER_LONG 32
65 34
66/* Dma addresses are 32-bits wide. */ 35/* Dma addresses are 32-bits wide. */
diff --git a/kernel/time.c b/kernel/time.c
index cbe0d5a222ff..6a08660b4fac 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -246,7 +246,7 @@ unsigned int inline jiffies_to_msecs(const unsigned long j)
246 return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC); 246 return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC);
247#else 247#else
248# if BITS_PER_LONG == 32 248# if BITS_PER_LONG == 32
249 return ((u64)HZ_TO_MSEC_MUL32 * j) >> HZ_TO_MSEC_SHR32; 249 return (HZ_TO_MSEC_MUL32 * j) >> HZ_TO_MSEC_SHR32;
250# else 250# else
251 return (j * HZ_TO_MSEC_NUM) / HZ_TO_MSEC_DEN; 251 return (j * HZ_TO_MSEC_NUM) / HZ_TO_MSEC_DEN;
252# endif 252# endif
@@ -262,7 +262,7 @@ unsigned int inline jiffies_to_usecs(const unsigned long j)
262 return (j + (HZ / USEC_PER_SEC) - 1)/(HZ / USEC_PER_SEC); 262 return (j + (HZ / USEC_PER_SEC) - 1)/(HZ / USEC_PER_SEC);
263#else 263#else
264# if BITS_PER_LONG == 32 264# if BITS_PER_LONG == 32
265 return ((u64)HZ_TO_USEC_MUL32 * j) >> HZ_TO_USEC_SHR32; 265 return (HZ_TO_USEC_MUL32 * j) >> HZ_TO_USEC_SHR32;
266# else 266# else
267 return (j * HZ_TO_USEC_NUM) / HZ_TO_USEC_DEN; 267 return (j * HZ_TO_USEC_NUM) / HZ_TO_USEC_DEN;
268# endif 268# endif
@@ -476,7 +476,7 @@ unsigned long msecs_to_jiffies(const unsigned int m)
476 if (HZ > MSEC_PER_SEC && m > jiffies_to_msecs(MAX_JIFFY_OFFSET)) 476 if (HZ > MSEC_PER_SEC && m > jiffies_to_msecs(MAX_JIFFY_OFFSET))
477 return MAX_JIFFY_OFFSET; 477 return MAX_JIFFY_OFFSET;
478 478
479 return ((u64)MSEC_TO_HZ_MUL32 * m + MSEC_TO_HZ_ADJ32) 479 return (MSEC_TO_HZ_MUL32 * m + MSEC_TO_HZ_ADJ32)
480 >> MSEC_TO_HZ_SHR32; 480 >> MSEC_TO_HZ_SHR32;
481#endif 481#endif
482} 482}
@@ -491,7 +491,7 @@ unsigned long usecs_to_jiffies(const unsigned int u)
491#elif HZ > USEC_PER_SEC && !(HZ % USEC_PER_SEC) 491#elif HZ > USEC_PER_SEC && !(HZ % USEC_PER_SEC)
492 return u * (HZ / USEC_PER_SEC); 492 return u * (HZ / USEC_PER_SEC);
493#else 493#else
494 return ((u64)USEC_TO_HZ_MUL32 * u + USEC_TO_HZ_ADJ32) 494 return (USEC_TO_HZ_MUL32 * u + USEC_TO_HZ_ADJ32)
495 >> USEC_TO_HZ_SHR32; 495 >> USEC_TO_HZ_SHR32;
496#endif 496#endif
497} 497}
diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl
index 41468035473c..eb51d76e058a 100644
--- a/kernel/timeconst.pl
+++ b/kernel/timeconst.pl
@@ -1,7 +1,7 @@
1#!/usr/bin/perl 1#!/usr/bin/perl
2# ----------------------------------------------------------------------- 2# -----------------------------------------------------------------------
3# 3#
4# Copyright 2007 rPath, Inc. - All Rights Reserved 4# Copyright 2007-2008 rPath, Inc. - All Rights Reserved
5# 5#
6# This file is part of the Linux kernel, and is made available under 6# This file is part of the Linux kernel, and is made available under
7# the terms of the GNU General Public License version 2 or (at your 7# the terms of the GNU General Public License version 2 or (at your
@@ -20,198 +20,138 @@
20%canned_values = ( 20%canned_values = (
21 24 => [ 21 24 => [
22 '0xa6aaaaab','0x2aaaaaa',26, 22 '0xa6aaaaab','0x2aaaaaa',26,
23 '0xa6aaaaaaaaaaaaab','0x2aaaaaaaaaaaaaa',58,
24 125,3, 23 125,3,
25 '0xc49ba5e4','0x1fbe76c8b4',37, 24 '0xc49ba5e4','0x1fbe76c8b4',37,
26 '0xc49ba5e353f7ceda','0x1fbe76c8b439581062',69,
27 3,125, 25 3,125,
28 '0xa2c2aaab','0xaaaa',16, 26 '0xa2c2aaab','0xaaaa',16,
29 '0xa2c2aaaaaaaaaaab','0xaaaaaaaaaaaa',48,
30 125000,3, 27 125000,3,
31 '0xc9539b89','0x7fffbce4217d',47, 28 '0xc9539b89','0x7fffbce4217d',47,
32 '0xc9539b8887229e91','0x7fffbce4217d2849cb25',79,
33 3,125000, 29 3,125000,
34 ], 32 => [ 30 ], 32 => [
35 '0xfa000000','0x6000000',27, 31 '0xfa000000','0x6000000',27,
36 '0xfa00000000000000','0x600000000000000',59,
37 125,4, 32 125,4,
38 '0x83126e98','0xfdf3b645a',36, 33 '0x83126e98','0xfdf3b645a',36,
39 '0x83126e978d4fdf3c','0xfdf3b645a1cac0831',68,
40 4,125, 34 4,125,
41 '0xf4240000','0x0',17, 35 '0xf4240000','0x0',17,
42 '0xf424000000000000','0x0',49,
43 31250,1, 36 31250,1,
44 '0x8637bd06','0x3fff79c842fa',46, 37 '0x8637bd06','0x3fff79c842fa',46,
45 '0x8637bd05af6c69b6','0x3fff79c842fa5093964a',78,
46 1,31250, 38 1,31250,
47 ], 48 => [ 39 ], 48 => [
48 '0xa6aaaaab','0x6aaaaaa',27, 40 '0xa6aaaaab','0x6aaaaaa',27,
49 '0xa6aaaaaaaaaaaaab','0x6aaaaaaaaaaaaaa',59,
50 125,6, 41 125,6,
51 '0xc49ba5e4','0xfdf3b645a',36, 42 '0xc49ba5e4','0xfdf3b645a',36,
52 '0xc49ba5e353f7ceda','0xfdf3b645a1cac0831',68,
53 6,125, 43 6,125,
54 '0xa2c2aaab','0x15555',17, 44 '0xa2c2aaab','0x15555',17,
55 '0xa2c2aaaaaaaaaaab','0x1555555555555',49,
56 62500,3, 45 62500,3,
57 '0xc9539b89','0x3fffbce4217d',46, 46 '0xc9539b89','0x3fffbce4217d',46,
58 '0xc9539b8887229e91','0x3fffbce4217d2849cb25',78,
59 3,62500, 47 3,62500,
60 ], 64 => [ 48 ], 64 => [
61 '0xfa000000','0xe000000',28, 49 '0xfa000000','0xe000000',28,
62 '0xfa00000000000000','0xe00000000000000',60,
63 125,8, 50 125,8,
64 '0x83126e98','0x7ef9db22d',35, 51 '0x83126e98','0x7ef9db22d',35,
65 '0x83126e978d4fdf3c','0x7ef9db22d0e560418',67,
66 8,125, 52 8,125,
67 '0xf4240000','0x0',18, 53 '0xf4240000','0x0',18,
68 '0xf424000000000000','0x0',50,
69 15625,1, 54 15625,1,
70 '0x8637bd06','0x1fff79c842fa',45, 55 '0x8637bd06','0x1fff79c842fa',45,
71 '0x8637bd05af6c69b6','0x1fff79c842fa5093964a',77,
72 1,15625, 56 1,15625,
73 ], 100 => [ 57 ], 100 => [
74 '0xa0000000','0x0',28, 58 '0xa0000000','0x0',28,
75 '0xa000000000000000','0x0',60,
76 10,1, 59 10,1,
77 '0xcccccccd','0x733333333',35, 60 '0xcccccccd','0x733333333',35,
78 '0xcccccccccccccccd','0x73333333333333333',67,
79 1,10, 61 1,10,
80 '0x9c400000','0x0',18, 62 '0x9c400000','0x0',18,
81 '0x9c40000000000000','0x0',50,
82 10000,1, 63 10000,1,
83 '0xd1b71759','0x1fff2e48e8a7',45, 64 '0xd1b71759','0x1fff2e48e8a7',45,
84 '0xd1b71758e219652c','0x1fff2e48e8a71de69ad4',77,
85 1,10000, 65 1,10000,
86 ], 122 => [ 66 ], 122 => [
87 '0x8325c53f','0xfbcda3a',28, 67 '0x8325c53f','0xfbcda3a',28,
88 '0x8325c53ef368eb05','0xfbcda3ac10c9714',60,
89 500,61, 68 500,61,
90 '0xf9db22d1','0x7fbe76c8b',35, 69 '0xf9db22d1','0x7fbe76c8b',35,
91 '0xf9db22d0e560418a','0x7fbe76c8b43958106',67,
92 61,500, 70 61,500,
93 '0x8012e2a0','0x3ef36',18, 71 '0x8012e2a0','0x3ef36',18,
94 '0x8012e29f79b47583','0x3ef368eb04325',50,
95 500000,61, 72 500000,61,
96 '0xffda4053','0x1ffffbce4217',45, 73 '0xffda4053','0x1ffffbce4217',45,
97 '0xffda4052d666a983','0x1ffffbce4217d2849cb2',77,
98 61,500000, 74 61,500000,
99 ], 128 => [ 75 ], 128 => [
100 '0xfa000000','0x1e000000',29, 76 '0xfa000000','0x1e000000',29,
101 '0xfa00000000000000','0x1e00000000000000',61,
102 125,16, 77 125,16,
103 '0x83126e98','0x3f7ced916',34, 78 '0x83126e98','0x3f7ced916',34,
104 '0x83126e978d4fdf3c','0x3f7ced916872b020c',66,
105 16,125, 79 16,125,
106 '0xf4240000','0x40000',19, 80 '0xf4240000','0x40000',19,
107 '0xf424000000000000','0x4000000000000',51,
108 15625,2, 81 15625,2,
109 '0x8637bd06','0xfffbce4217d',44, 82 '0x8637bd06','0xfffbce4217d',44,
110 '0x8637bd05af6c69b6','0xfffbce4217d2849cb25',76,
111 2,15625, 83 2,15625,
112 ], 200 => [ 84 ], 200 => [
113 '0xa0000000','0x0',29, 85 '0xa0000000','0x0',29,
114 '0xa000000000000000','0x0',61,
115 5,1, 86 5,1,
116 '0xcccccccd','0x333333333',34, 87 '0xcccccccd','0x333333333',34,
117 '0xcccccccccccccccd','0x33333333333333333',66,
118 1,5, 88 1,5,
119 '0x9c400000','0x0',19, 89 '0x9c400000','0x0',19,
120 '0x9c40000000000000','0x0',51,
121 5000,1, 90 5000,1,
122 '0xd1b71759','0xfff2e48e8a7',44, 91 '0xd1b71759','0xfff2e48e8a7',44,
123 '0xd1b71758e219652c','0xfff2e48e8a71de69ad4',76,
124 1,5000, 92 1,5000,
125 ], 250 => [ 93 ], 250 => [
126 '0x80000000','0x0',29, 94 '0x80000000','0x0',29,
127 '0x8000000000000000','0x0',61,
128 4,1, 95 4,1,
129 '0x80000000','0x180000000',33, 96 '0x80000000','0x180000000',33,
130 '0x8000000000000000','0x18000000000000000',65,
131 1,4, 97 1,4,
132 '0xfa000000','0x0',20, 98 '0xfa000000','0x0',20,
133 '0xfa00000000000000','0x0',52,
134 4000,1, 99 4000,1,
135 '0x83126e98','0x7ff7ced9168',43, 100 '0x83126e98','0x7ff7ced9168',43,
136 '0x83126e978d4fdf3c','0x7ff7ced916872b020c4',75,
137 1,4000, 101 1,4000,
138 ], 256 => [ 102 ], 256 => [
139 '0xfa000000','0x3e000000',30, 103 '0xfa000000','0x3e000000',30,
140 '0xfa00000000000000','0x3e00000000000000',62,
141 125,32, 104 125,32,
142 '0x83126e98','0x1fbe76c8b',33, 105 '0x83126e98','0x1fbe76c8b',33,
143 '0x83126e978d4fdf3c','0x1fbe76c8b43958106',65,
144 32,125, 106 32,125,
145 '0xf4240000','0xc0000',20, 107 '0xf4240000','0xc0000',20,
146 '0xf424000000000000','0xc000000000000',52,
147 15625,4, 108 15625,4,
148 '0x8637bd06','0x7ffde7210be',43, 109 '0x8637bd06','0x7ffde7210be',43,
149 '0x8637bd05af6c69b6','0x7ffde7210be9424e592',75,
150 4,15625, 110 4,15625,
151 ], 300 => [ 111 ], 300 => [
152 '0xd5555556','0x2aaaaaaa',30, 112 '0xd5555556','0x2aaaaaaa',30,
153 '0xd555555555555556','0x2aaaaaaaaaaaaaaa',62,
154 10,3, 113 10,3,
155 '0x9999999a','0x1cccccccc',33, 114 '0x9999999a','0x1cccccccc',33,
156 '0x999999999999999a','0x1cccccccccccccccc',65,
157 3,10, 115 3,10,
158 '0xd0555556','0xaaaaa',20, 116 '0xd0555556','0xaaaaa',20,
159 '0xd055555555555556','0xaaaaaaaaaaaaa',52,
160 10000,3, 117 10000,3,
161 '0x9d495183','0x7ffcb923a29',43, 118 '0x9d495183','0x7ffcb923a29',43,
162 '0x9d495182a9930be1','0x7ffcb923a29c779a6b5',75,
163 3,10000, 119 3,10000,
164 ], 512 => [ 120 ], 512 => [
165 '0xfa000000','0x7e000000',31, 121 '0xfa000000','0x7e000000',31,
166 '0xfa00000000000000','0x7e00000000000000',63,
167 125,64, 122 125,64,
168 '0x83126e98','0xfdf3b645',32, 123 '0x83126e98','0xfdf3b645',32,
169 '0x83126e978d4fdf3c','0xfdf3b645a1cac083',64,
170 64,125, 124 64,125,
171 '0xf4240000','0x1c0000',21, 125 '0xf4240000','0x1c0000',21,
172 '0xf424000000000000','0x1c000000000000',53,
173 15625,8, 126 15625,8,
174 '0x8637bd06','0x3ffef39085f',42, 127 '0x8637bd06','0x3ffef39085f',42,
175 '0x8637bd05af6c69b6','0x3ffef39085f4a1272c9',74,
176 8,15625, 128 8,15625,
177 ], 1000 => [ 129 ], 1000 => [
178 '0x80000000','0x0',31, 130 '0x80000000','0x0',31,
179 '0x8000000000000000','0x0',63,
180 1,1, 131 1,1,
181 '0x80000000','0x0',31, 132 '0x80000000','0x0',31,
182 '0x8000000000000000','0x0',63,
183 1,1, 133 1,1,
184 '0xfa000000','0x0',22, 134 '0xfa000000','0x0',22,
185 '0xfa00000000000000','0x0',54,
186 1000,1, 135 1000,1,
187 '0x83126e98','0x1ff7ced9168',41, 136 '0x83126e98','0x1ff7ced9168',41,
188 '0x83126e978d4fdf3c','0x1ff7ced916872b020c4',73,
189 1,1000, 137 1,1000,
190 ], 1024 => [ 138 ], 1024 => [
191 '0xfa000000','0xfe000000',32, 139 '0xfa000000','0xfe000000',32,
192 '0xfa00000000000000','0xfe00000000000000',64,
193 125,128, 140 125,128,
194 '0x83126e98','0x7ef9db22',31, 141 '0x83126e98','0x7ef9db22',31,
195 '0x83126e978d4fdf3c','0x7ef9db22d0e56041',63,
196 128,125, 142 128,125,
197 '0xf4240000','0x3c0000',22, 143 '0xf4240000','0x3c0000',22,
198 '0xf424000000000000','0x3c000000000000',54,
199 15625,16, 144 15625,16,
200 '0x8637bd06','0x1fff79c842f',41, 145 '0x8637bd06','0x1fff79c842f',41,
201 '0x8637bd05af6c69b6','0x1fff79c842fa5093964',73,
202 16,15625, 146 16,15625,
203 ], 1200 => [ 147 ], 1200 => [
204 '0xd5555556','0xd5555555',32, 148 '0xd5555556','0xd5555555',32,
205 '0xd555555555555556','0xd555555555555555',64,
206 5,6, 149 5,6,
207 '0x9999999a','0x66666666',31, 150 '0x9999999a','0x66666666',31,
208 '0x999999999999999a','0x6666666666666666',63,
209 6,5, 151 6,5,
210 '0xd0555556','0x2aaaaa',22, 152 '0xd0555556','0x2aaaaa',22,
211 '0xd055555555555556','0x2aaaaaaaaaaaaa',54,
212 2500,3, 153 2500,3,
213 '0x9d495183','0x1ffcb923a29',41, 154 '0x9d495183','0x1ffcb923a29',41,
214 '0x9d495182a9930be1','0x1ffcb923a29c779a6b5',73,
215 3,2500, 155 3,2500,
216 ] 156 ]
217); 157);
@@ -264,6 +204,15 @@ sub fmuls($$$) {
264 return 0; 204 return 0;
265} 205}
266 206
207# Generate a hex value if the result fits in 64 bits;
208# otherwise skip.
209sub bignum_hex($) {
210 my($x) = @_;
211 my $s = $x->as_hex();
212
213 return (length($s) > 18) ? undef : $s;
214}
215
267# Provides mul, adj, and shr factors for a specific 216# Provides mul, adj, and shr factors for a specific
268# (bit, time, hz) combination 217# (bit, time, hz) combination
269sub muladj($$$) { 218sub muladj($$$) {
@@ -271,7 +220,7 @@ sub muladj($$$) {
271 my $s = fmuls($b, $t, $hz); 220 my $s = fmuls($b, $t, $hz);
272 my $m = fmul($s, $t, $hz); 221 my $m = fmul($s, $t, $hz);
273 my $a = fadj($s, $t, $hz); 222 my $a = fadj($s, $t, $hz);
274 return ($m->as_hex(), $a->as_hex(), $s); 223 return (bignum_hex($m), bignum_hex($a), $s);
275} 224}
276 225
277# Provides numerator, denominator values 226# Provides numerator, denominator values
@@ -288,12 +237,10 @@ sub conversions($$) {
288 237
289 # HZ_TO_xx 238 # HZ_TO_xx
290 push(@val, muladj(32, $t, $hz)); 239 push(@val, muladj(32, $t, $hz));
291 push(@val, muladj(64, $t, $hz));
292 push(@val, numden($t, $hz)); 240 push(@val, numden($t, $hz));
293 241
294 # xx_TO_HZ 242 # xx_TO_HZ
295 push(@val, muladj(32, $hz, $t)); 243 push(@val, muladj(32, $hz, $t));
296 push(@val, muladj(64, $hz, $t));
297 push(@val, numden($hz, $t)); 244 push(@val, numden($hz, $t));
298 245
299 return @val; 246 return @val;
@@ -318,6 +265,19 @@ sub compute_values($) {
318 return @val; 265 return @val;
319} 266}
320 267
268sub outputval($$)
269{
270 my($name, $val) = @_;
271 my $csuf;
272
273 if (defined($val)) {
274 if ($name !~ /SHR/) {
275 $val = "U64_C($val)";
276 }
277 printf "#define %-23s %s\n", $name.$csuf, $val.$csuf;
278 }
279}
280
321sub output($@) 281sub output($@)
322{ 282{
323 my($hz, @val) = @_; 283 my($hz, @val) = @_;
@@ -331,6 +291,7 @@ sub output($@)
331 print "\n"; 291 print "\n";
332 292
333 print "#include <linux/param.h>\n"; 293 print "#include <linux/param.h>\n";
294 print "#include <linux/types.h>\n";
334 295
335 print "\n"; 296 print "\n";
336 print "#if HZ != $hz\n"; 297 print "#if HZ != $hz\n";
@@ -340,15 +301,13 @@ sub output($@)
340 301
341 foreach $pfx ('HZ_TO_MSEC','MSEC_TO_HZ', 302 foreach $pfx ('HZ_TO_MSEC','MSEC_TO_HZ',
342 'HZ_TO_USEC','USEC_TO_HZ') { 303 'HZ_TO_USEC','USEC_TO_HZ') {
343 foreach $bit (32, 64) { 304 foreach $bit (32) {
344 foreach $suf ('MUL', 'ADJ', 'SHR') { 305 foreach $suf ('MUL', 'ADJ', 'SHR') {
345 printf "#define %-23s %s\n", 306 outputval("${pfx}_$suf$bit", shift(@val));
346 "${pfx}_$suf$bit", shift(@val);
347 } 307 }
348 } 308 }
349 foreach $suf ('NUM', 'DEN') { 309 foreach $suf ('NUM', 'DEN') {
350 printf "#define %-23s %s\n", 310 outputval("${pfx}_$suf", shift(@val));
351 "${pfx}_$suf", shift(@val);
352 } 311 }
353 } 312 }
354 313
@@ -356,6 +315,23 @@ sub output($@)
356 print "#endif /* KERNEL_TIMECONST_H */\n"; 315 print "#endif /* KERNEL_TIMECONST_H */\n";
357} 316}
358 317
318# Pretty-print Perl values
319sub perlvals(@) {
320 my $v;
321 my @l = ();
322
323 foreach $v (@_) {
324 if (!defined($v)) {
325 push(@l, 'undef');
326 } elsif ($v =~ /^0x/) {
327 push(@l, "\'".$v."\'");
328 } else {
329 push(@l, $v.'');
330 }
331 }
332 return join(',', @l);
333}
334
359($hz) = @ARGV; 335($hz) = @ARGV;
360 336
361# Use this to generate the %canned_values structure 337# Use this to generate the %canned_values structure
@@ -373,15 +349,15 @@ if ($hz eq '--can') {
373 print "$pf$hz => [\n"; 349 print "$pf$hz => [\n";
374 while (scalar(@values)) { 350 while (scalar(@values)) {
375 my $bit; 351 my $bit;
376 foreach $bit (32, 64) { 352 foreach $bit (32) {
377 my $m = shift(@values); 353 my $m = shift(@values);
378 my $a = shift(@values); 354 my $a = shift(@values);
379 my $s = shift(@values); 355 my $s = shift(@values);
380 print "\t\t\'",$m,"\',\'",$a,"\',",$s,",\n"; 356 print "\t\t", perlvals($m,$a,$s), ",\n";
381 } 357 }
382 my $n = shift(@values); 358 my $n = shift(@values);
383 my $d = shift(@values); 359 my $d = shift(@values);
384 print "\t\t",$n,',',$d,",\n"; 360 print "\t\t", perlvals($n,$d), ",\n";
385 } 361 }
386 print "\t]"; 362 print "\t]";
387 $pf = ', '; 363 $pf = ', ';