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 return (void __user
*)(long)uptr
;
138 static inline compat_uptr_t
ptr_to_compat(void __user
*uptr
)
140 return (u32
)(unsigned long)uptr
;
143 static inline void __user
*compat_alloc_user_space(long len
)
145 struct pt_regs
*regs
= (struct pt_regs
*)
146 ((unsigned long) current_thread_info() + THREAD_SIZE
- 32) - 1;
148 return (void __user
*) (regs
->regs
[29] - len
);
151 struct compat_ipc64_perm
{
153 __compat_uid32_t uid
;
154 __compat_gid32_t gid
;
155 __compat_uid32_t cuid
;
156 __compat_gid32_t cgid
;
159 unsigned short __pad2
;
160 compat_ulong_t __unused1
;
161 compat_ulong_t __unused2
;
164 struct compat_semid64_ds
{
165 struct compat_ipc64_perm sem_perm
;
166 compat_time_t sem_otime
;
167 compat_time_t sem_ctime
;
168 compat_ulong_t sem_nsems
;
169 compat_ulong_t __unused1
;
170 compat_ulong_t __unused2
;
173 struct compat_msqid64_ds
{
174 struct compat_ipc64_perm msg_perm
;
175 #ifndef CONFIG_CPU_LITTLE_ENDIAN
176 compat_ulong_t __unused1
;
178 compat_time_t msg_stime
;
179 #ifdef CONFIG_CPU_LITTLE_ENDIAN
180 compat_ulong_t __unused1
;
182 #ifndef CONFIG_CPU_LITTLE_ENDIAN
183 compat_ulong_t __unused2
;
185 compat_time_t msg_rtime
;
186 #ifdef CONFIG_CPU_LITTLE_ENDIAN
187 compat_ulong_t __unused2
;
189 #ifndef CONFIG_CPU_LITTLE_ENDIAN
190 compat_ulong_t __unused3
;
192 compat_time_t msg_ctime
;
193 #ifdef CONFIG_CPU_LITTLE_ENDIAN
194 compat_ulong_t __unused3
;
196 compat_ulong_t msg_cbytes
;
197 compat_ulong_t msg_qnum
;
198 compat_ulong_t msg_qbytes
;
199 compat_pid_t msg_lspid
;
200 compat_pid_t msg_lrpid
;
201 compat_ulong_t __unused4
;
202 compat_ulong_t __unused5
;
205 struct compat_shmid64_ds
{
206 struct compat_ipc64_perm shm_perm
;
207 compat_size_t shm_segsz
;
208 compat_time_t shm_atime
;
209 compat_time_t shm_dtime
;
210 compat_time_t shm_ctime
;
211 compat_pid_t shm_cpid
;
212 compat_pid_t shm_lpid
;
213 compat_ulong_t shm_nattch
;
214 compat_ulong_t __unused1
;
215 compat_ulong_t __unused2
;
218 #endif /* _ASM_COMPAT_H */