aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic')
-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
3 files changed, 149 insertions, 0 deletions
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 */