diff options
author | H. Peter Anvin <hpa@zytor.com> | 2012-02-14 16:11:31 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-02-20 15:48:47 -0500 |
commit | afead38d011ab2f333d12ebb6752ed9baa53b667 (patch) | |
tree | 2812951df334a1bf6f21c82797090651d8044ce7 /include/asm-generic | |
parent | d8e5ddef21df05bc2a14d8c0e287cbf083da60a3 (diff) |
posix_types: Introduce __kernel_[u]long_t
Introduce __kernel_[u]long_t, which allows an ABI to override all
defaults of type [unsigned] long.
This enables x32 and potentially other 32-bit userspace on 64-bit
kernel ABIs.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/posix_types.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/include/asm-generic/posix_types.h b/include/asm-generic/posix_types.h index e294fe66125b..91d44bd4dde3 100644 --- a/include/asm-generic/posix_types.h +++ b/include/asm-generic/posix_types.h | |||
@@ -10,8 +10,13 @@ | |||
10 | * architectures, so that you can override them. | 10 | * architectures, so that you can override them. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #ifndef __kernel_long_t | ||
14 | typedef long __kernel_long_t; | ||
15 | typedef unsigned long __kernel_ulong_t; | ||
16 | #endif | ||
17 | |||
13 | #ifndef __kernel_ino_t | 18 | #ifndef __kernel_ino_t |
14 | typedef unsigned long __kernel_ino_t; | 19 | typedef __kernel_ulong_t __kernel_ino_t; |
15 | #endif | 20 | #endif |
16 | 21 | ||
17 | #ifndef __kernel_mode_t | 22 | #ifndef __kernel_mode_t |
@@ -19,7 +24,7 @@ typedef unsigned int __kernel_mode_t; | |||
19 | #endif | 24 | #endif |
20 | 25 | ||
21 | #ifndef __kernel_nlink_t | 26 | #ifndef __kernel_nlink_t |
22 | typedef unsigned long __kernel_nlink_t; | 27 | typedef __kernel_ulong_t __kernel_nlink_t; |
23 | #endif | 28 | #endif |
24 | 29 | ||
25 | #ifndef __kernel_pid_t | 30 | #ifndef __kernel_pid_t |
@@ -36,7 +41,7 @@ typedef unsigned int __kernel_gid_t; | |||
36 | #endif | 41 | #endif |
37 | 42 | ||
38 | #ifndef __kernel_suseconds_t | 43 | #ifndef __kernel_suseconds_t |
39 | typedef long __kernel_suseconds_t; | 44 | typedef __kernel_long_t __kernel_suseconds_t; |
40 | #endif | 45 | #endif |
41 | 46 | ||
42 | #ifndef __kernel_daddr_t | 47 | #ifndef __kernel_daddr_t |
@@ -67,9 +72,9 @@ typedef unsigned int __kernel_size_t; | |||
67 | typedef int __kernel_ssize_t; | 72 | typedef int __kernel_ssize_t; |
68 | typedef int __kernel_ptrdiff_t; | 73 | typedef int __kernel_ptrdiff_t; |
69 | #else | 74 | #else |
70 | typedef unsigned long __kernel_size_t; | 75 | typedef __kernel_ulong_t __kernel_size_t; |
71 | typedef long __kernel_ssize_t; | 76 | typedef __kernel_long_t __kernel_ssize_t; |
72 | typedef long __kernel_ptrdiff_t; | 77 | typedef __kernel_long_t __kernel_ptrdiff_t; |
73 | #endif | 78 | #endif |
74 | #endif | 79 | #endif |
75 | 80 | ||
@@ -82,10 +87,10 @@ typedef struct { | |||
82 | /* | 87 | /* |
83 | * anything below here should be completely generic | 88 | * anything below here should be completely generic |
84 | */ | 89 | */ |
85 | typedef long __kernel_off_t; | 90 | typedef __kernel_long_t __kernel_off_t; |
86 | typedef long long __kernel_loff_t; | 91 | typedef long long __kernel_loff_t; |
87 | typedef long __kernel_time_t; | 92 | typedef __kernel_long_t __kernel_time_t; |
88 | typedef long __kernel_clock_t; | 93 | typedef __kernel_long_t __kernel_clock_t; |
89 | typedef int __kernel_timer_t; | 94 | typedef int __kernel_timer_t; |
90 | typedef int __kernel_clockid_t; | 95 | typedef int __kernel_clockid_t; |
91 | typedef char * __kernel_caddr_t; | 96 | typedef char * __kernel_caddr_t; |