4 * Architecture specific compatibility types
6 #include <linux/types.h>
8 #include <asm/ptrace.h>
10 #define COMPAT_USER_HZ 100
12 typedef u32 compat_size_t
;
13 typedef s32 compat_ssize_t
;
14 typedef s32 compat_time_t
;
15 typedef s32 compat_clock_t
;
16 typedef s32 compat_suseconds_t
;
18 typedef s32 compat_pid_t
;
19 typedef s32 __compat_uid_t
;
20 typedef s32 __compat_gid_t
;
21 typedef __compat_uid_t __compat_uid32_t
;
22 typedef __compat_gid_t __compat_gid32_t
;
23 typedef u32 compat_mode_t
;
24 typedef u32 compat_ino_t
;
25 typedef u32 compat_dev_t
;
26 typedef s32 compat_off_t
;
27 typedef s64 compat_loff_t
;
28 typedef u32 compat_nlink_t
;
29 typedef s32 compat_ipc_pid_t
;
30 typedef s32 compat_daddr_t
;
31 typedef s32 compat_caddr_t
;
35 typedef s32 compat_timer_t
;
36 typedef s32 compat_key_t
;
38 typedef s32 compat_int_t
;
39 typedef s32 compat_long_t
;
40 typedef u32 compat_uint_t
;
41 typedef u32 compat_ulong_t
;
43 struct compat_timespec
{
48 struct compat_timeval
{
57 compat_mode_t st_mode
;
58 compat_nlink_t st_nlink
;
59 __compat_uid_t st_uid
;
60 __compat_gid_t st_gid
;
65 compat_time_t st_atime
;
67 compat_time_t st_mtime
;
69 compat_time_t st_ctime
;
91 struct compat_flock64
{
94 compat_loff_t l_start
;
99 struct compat_statfs
{
108 compat_fsid_t f_fsid
;
113 #define COMPAT_RLIM_INFINITY 0x7fffffffUL
115 typedef u32 compat_old_sigset_t
; /* at least 32 bits */
117 #define _COMPAT_NSIG 128 /* Don't ask !$@#% ... */
118 #define _COMPAT_NSIG_BPW 32
120 typedef u32 compat_sigset_word
;
122 #define COMPAT_OFF_T_MAX 0x7fffffff
123 #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
126 * A pointer passed in from user mode. This should not
127 * be used for syscall parameters, just declare them
128 * as pointers because the syscall entry code will have
129 * appropriately comverted them already.
131 typedef u32 compat_uptr_t
;
133 static inline void __user
*compat_ptr(compat_uptr_t uptr
)
135 /* cast to a __user pointer via "unsigned long" makes sparse happy */
136 return (void __user
*)(unsigned long)(long)uptr
;
139 static inline compat_uptr_t
ptr_to_compat(void __user
*uptr
)
141 return (u32
)(unsigned long)uptr
;
144 static inline void __user
*compat_alloc_user_space(long len
)
146 struct pt_regs
*regs
= (struct pt_regs
*)
147 ((unsigned long) current_thread_info() + THREAD_SIZE
- 32) - 1;
149 return (void __user
*) (regs
->regs
[29] - len
);
152 struct compat_ipc64_perm
{
154 __compat_uid32_t uid
;
155 __compat_gid32_t gid
;
156 __compat_uid32_t cuid
;
157 __compat_gid32_t cgid
;
160 unsigned short __pad2
;
161 compat_ulong_t __unused1
;
162 compat_ulong_t __unused2
;
165 struct compat_semid64_ds
{
166 struct compat_ipc64_perm sem_perm
;
167 compat_time_t sem_otime
;
168 compat_time_t sem_ctime
;
169 compat_ulong_t sem_nsems
;
170 compat_ulong_t __unused1
;
171 compat_ulong_t __unused2
;
174 struct compat_msqid64_ds
{
175 struct compat_ipc64_perm msg_perm
;
176 #ifndef CONFIG_CPU_LITTLE_ENDIAN
177 compat_ulong_t __unused1
;
179 compat_time_t msg_stime
;
180 #ifdef CONFIG_CPU_LITTLE_ENDIAN
181 compat_ulong_t __unused1
;
183 #ifndef CONFIG_CPU_LITTLE_ENDIAN
184 compat_ulong_t __unused2
;
186 compat_time_t msg_rtime
;
187 #ifdef CONFIG_CPU_LITTLE_ENDIAN
188 compat_ulong_t __unused2
;
190 #ifndef CONFIG_CPU_LITTLE_ENDIAN
191 compat_ulong_t __unused3
;
193 compat_time_t msg_ctime
;
194 #ifdef CONFIG_CPU_LITTLE_ENDIAN
195 compat_ulong_t __unused3
;
197 compat_ulong_t msg_cbytes
;
198 compat_ulong_t msg_qnum
;
199 compat_ulong_t msg_qbytes
;
200 compat_pid_t msg_lspid
;
201 compat_pid_t msg_lrpid
;
202 compat_ulong_t __unused4
;
203 compat_ulong_t __unused5
;
206 struct compat_shmid64_ds
{
207 struct compat_ipc64_perm shm_perm
;
208 compat_size_t shm_segsz
;
209 compat_time_t shm_atime
;
210 compat_time_t shm_dtime
;
211 compat_time_t shm_ctime
;
212 compat_pid_t shm_cpid
;
213 compat_pid_t shm_lpid
;
214 compat_ulong_t shm_nattch
;
215 compat_ulong_t __unused1
;
216 compat_ulong_t __unused2
;
219 #endif /* _ASM_COMPAT_H */