1 #ifndef _ASM_PARISC_COMPAT_H
2 #define _ASM_PARISC_COMPAT_H
4 * Architecture specific compatibility types
6 #include <linux/types.h>
7 #include <linux/sched.h>
8 #include <linux/thread_info.h>
10 #define COMPAT_USER_HZ 100
11 #define COMPAT_UTS_MACHINE "parisc\0\0"
13 typedef u32 compat_size_t
;
14 typedef s32 compat_ssize_t
;
15 typedef s32 compat_time_t
;
16 typedef s32 compat_clock_t
;
17 typedef s32 compat_pid_t
;
18 typedef u32 __compat_uid_t
;
19 typedef u32 __compat_gid_t
;
20 typedef u32 __compat_uid32_t
;
21 typedef u32 __compat_gid32_t
;
22 typedef u16 compat_mode_t
;
23 typedef u32 compat_ino_t
;
24 typedef u32 compat_dev_t
;
25 typedef s32 compat_off_t
;
26 typedef s64 compat_loff_t
;
27 typedef u16 compat_nlink_t
;
28 typedef u16 compat_ipc_pid_t
;
29 typedef s32 compat_daddr_t
;
30 typedef u32 compat_caddr_t
;
31 typedef s32 compat_key_t
;
32 typedef s32 compat_timer_t
;
34 typedef s32 compat_int_t
;
35 typedef s32 compat_long_t
;
36 typedef s64 compat_s64
;
37 typedef u32 compat_uint_t
;
38 typedef u32 compat_ulong_t
;
39 typedef u64 compat_u64
;
40 typedef u32 compat_uptr_t
;
42 struct compat_timespec
{
47 struct compat_timeval
{
53 compat_dev_t st_dev
; /* dev_t is 32 bits on parisc */
54 compat_ino_t st_ino
; /* 32 bits */
55 compat_mode_t st_mode
; /* 16 bits */
56 compat_nlink_t st_nlink
; /* 16 bits */
57 u16 st_reserved1
; /* old st_uid */
58 u16 st_reserved2
; /* old st_gid */
61 compat_time_t st_atime
;
63 compat_time_t st_mtime
;
65 compat_time_t st_ctime
;
69 u32 __unused1
; /* ACL stuff */
70 compat_dev_t __unused2
; /* network */
71 compat_ino_t __unused3
; /* network */
72 u32 __unused4
; /* cnodes */
73 u16 __unused5
; /* netsite */
75 compat_dev_t st_realdev
;
78 __compat_uid32_t st_uid
;
79 __compat_gid32_t st_gid
;
91 struct compat_flock64
{
94 compat_loff_t l_start
;
99 struct compat_statfs
{
107 __kernel_fsid_t f_fsid
;
114 struct compat_sigcontext
{
115 compat_int_t sc_flags
;
116 compat_int_t sc_gr
[32]; /* PSW in sc_gr[0] */
118 compat_int_t sc_iasq
[2];
119 compat_int_t sc_iaoq
[2];
120 compat_int_t sc_sar
; /* cr11 */
123 #define COMPAT_RLIM_INFINITY 0xffffffff
125 typedef u32 compat_old_sigset_t
; /* at least 32 bits */
127 #define _COMPAT_NSIG 64
128 #define _COMPAT_NSIG_BPW 32
130 typedef u32 compat_sigset_word
;
132 typedef union compat_sigval
{
133 compat_int_t sival_int
;
134 compat_uptr_t sival_ptr
;
137 typedef struct compat_siginfo
{
143 int _pad
[128/sizeof(int) - 3];
147 unsigned int _pid
; /* sender's pid */
148 unsigned int _uid
; /* sender's uid */
151 /* POSIX.1b timers */
153 compat_timer_t _tid
; /* timer id */
154 int _overrun
; /* overrun count */
155 char _pad
[sizeof(unsigned int) - sizeof(int)];
156 compat_sigval_t _sigval
; /* same as below */
157 int _sys_private
; /* not to be passed to user */
160 /* POSIX.1b signals */
162 unsigned int _pid
; /* sender's pid */
163 unsigned int _uid
; /* sender's uid */
164 compat_sigval_t _sigval
;
169 unsigned int _pid
; /* which child */
170 unsigned int _uid
; /* sender's uid */
171 int _status
; /* exit code */
172 compat_clock_t _utime
;
173 compat_clock_t _stime
;
176 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
178 unsigned int _addr
; /* faulting insn/memory ref. */
183 int _band
; /* POLL_IN, POLL_OUT, POLL_MSG */
189 #define COMPAT_OFF_T_MAX 0x7fffffff
190 #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
192 struct compat_ipc64_perm
{
198 unsigned short int __pad1
;
200 unsigned short int __pad2
;
201 unsigned short int seq
;
203 unsigned long __unused1
; /* yes they really are 64bit pads */
204 unsigned long __unused2
;
207 struct compat_semid64_ds
{
208 struct compat_ipc64_perm sem_perm
;
209 compat_time_t sem_otime
;
210 unsigned int __unused1
;
211 compat_time_t sem_ctime
;
212 unsigned int __unused2
;
213 compat_ulong_t sem_nsems
;
214 compat_ulong_t __unused3
;
215 compat_ulong_t __unused4
;
218 struct compat_msqid64_ds
{
219 struct compat_ipc64_perm msg_perm
;
220 unsigned int __unused1
;
221 compat_time_t msg_stime
;
222 unsigned int __unused2
;
223 compat_time_t msg_rtime
;
224 unsigned int __unused3
;
225 compat_time_t msg_ctime
;
226 compat_ulong_t msg_cbytes
;
227 compat_ulong_t msg_qnum
;
228 compat_ulong_t msg_qbytes
;
229 compat_pid_t msg_lspid
;
230 compat_pid_t msg_lrpid
;
231 compat_ulong_t __unused4
;
232 compat_ulong_t __unused5
;
235 struct compat_shmid64_ds
{
236 struct compat_ipc64_perm shm_perm
;
237 unsigned int __unused1
;
238 compat_time_t shm_atime
;
239 unsigned int __unused2
;
240 compat_time_t shm_dtime
;
241 unsigned int __unused3
;
242 compat_time_t shm_ctime
;
243 unsigned int __unused4
;
244 compat_size_t shm_segsz
;
245 compat_pid_t shm_cpid
;
246 compat_pid_t shm_lpid
;
247 compat_ulong_t shm_nattch
;
248 compat_ulong_t __unused5
;
249 compat_ulong_t __unused6
;
253 * A pointer passed in from user mode. This should not
254 * be used for syscall parameters, just declare them
255 * as pointers because the syscall entry code will have
256 * appropriately converted them already.
259 static inline void __user
*compat_ptr(compat_uptr_t uptr
)
261 return (void __user
*)(unsigned long)uptr
;
264 static inline compat_uptr_t
ptr_to_compat(void __user
*uptr
)
266 return (u32
)(unsigned long)uptr
;
269 static __inline__
void __user
*arch_compat_alloc_user_space(long len
)
271 struct pt_regs
*regs
= ¤t
->thread
.regs
;
272 return (void __user
*)regs
->gr
[30];
275 static inline int __is_compat_task(struct task_struct
*t
)
277 return test_ti_thread_flag(task_thread_info(t
), TIF_32BIT
);
280 static inline int is_compat_task(void)
282 return __is_compat_task(current
);
285 #endif /* _ASM_PARISC_COMPAT_H */