Merge remote-tracking branch 's5p/for-next'
[linux-2.6/next.git] / arch / s390 / kernel / compat_linux.h
blob9635d759c2b9fbb107e39f326ff7b638bc353c36
1 #ifndef _ASM_S390X_S390_H
2 #define _ASM_S390X_S390_H
4 #include <linux/compat.h>
5 #include <linux/socket.h>
6 #include <linux/syscalls.h>
8 /* Macro that masks the high order bit of an 32 bit pointer and converts it*/
9 /* to a 64 bit pointer */
10 #define A(__x) ((unsigned long)((__x) & 0x7FFFFFFFUL))
11 #define AA(__x) \
12 ((unsigned long)(__x))
14 /* Now 32bit compatibility types */
15 struct ipc_kludge_32 {
16 __u32 msgp; /* pointer */
17 __s32 msgtyp;
20 struct old_sigaction32 {
21 __u32 sa_handler; /* Really a pointer, but need to deal with 32 bits */
22 compat_old_sigset_t sa_mask; /* A 32 bit mask */
23 __u32 sa_flags;
24 __u32 sa_restorer; /* Another 32 bit pointer */
27 typedef struct compat_siginfo {
28 int si_signo;
29 int si_errno;
30 int si_code;
32 union {
33 int _pad[((128/sizeof(int)) - 3)];
35 /* kill() */
36 struct {
37 pid_t _pid; /* sender's pid */
38 uid_t _uid; /* sender's uid */
39 } _kill;
41 /* POSIX.1b timers */
42 struct {
43 compat_timer_t _tid; /* timer id */
44 int _overrun; /* overrun count */
45 compat_sigval_t _sigval; /* same as below */
46 int _sys_private; /* not to be passed to user */
47 } _timer;
49 /* POSIX.1b signals */
50 struct {
51 pid_t _pid; /* sender's pid */
52 uid_t _uid; /* sender's uid */
53 compat_sigval_t _sigval;
54 } _rt;
56 /* SIGCHLD */
57 struct {
58 pid_t _pid; /* which child */
59 uid_t _uid; /* sender's uid */
60 int _status;/* exit code */
61 compat_clock_t _utime;
62 compat_clock_t _stime;
63 } _sigchld;
65 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
66 struct {
67 __u32 _addr; /* faulting insn/memory ref. - pointer */
68 } _sigfault;
70 /* SIGPOLL */
71 struct {
72 int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
73 int _fd;
74 } _sigpoll;
75 } _sifields;
76 } compat_siginfo_t;
79 * How these fields are to be accessed.
81 #define si_pid _sifields._kill._pid
82 #define si_uid _sifields._kill._uid
83 #define si_status _sifields._sigchld._status
84 #define si_utime _sifields._sigchld._utime
85 #define si_stime _sifields._sigchld._stime
86 #define si_value _sifields._rt._sigval
87 #define si_int _sifields._rt._sigval.sival_int
88 #define si_ptr _sifields._rt._sigval.sival_ptr
89 #define si_addr _sifields._sigfault._addr
90 #define si_band _sifields._sigpoll._band
91 #define si_fd _sifields._sigpoll._fd
92 #define si_tid _sifields._timer._tid
93 #define si_overrun _sifields._timer._overrun
95 /* asm/sigcontext.h */
96 typedef union
98 __u64 d;
99 __u32 f;
100 } freg_t32;
102 typedef struct
104 unsigned int fpc;
105 freg_t32 fprs[__NUM_FPRS];
106 } _s390_fp_regs32;
108 typedef struct
110 __u32 mask;
111 __u32 addr;
112 } _psw_t32 __attribute__ ((aligned(8)));
114 typedef struct
116 _psw_t32 psw;
117 __u32 gprs[__NUM_GPRS];
118 __u32 acrs[__NUM_ACRS];
119 } _s390_regs_common32;
121 typedef struct
123 _s390_regs_common32 regs;
124 _s390_fp_regs32 fpregs;
125 } _sigregs32;
127 #define _SIGCONTEXT_NSIG32 64
128 #define _SIGCONTEXT_NSIG_BPW32 32
129 #define __SIGNAL_FRAMESIZE32 96
130 #define _SIGMASK_COPY_SIZE32 (sizeof(u32)*2)
132 struct sigcontext32
134 __u32 oldmask[_COMPAT_NSIG_WORDS];
135 __u32 sregs; /* pointer */
138 /* asm/signal.h */
139 struct sigaction32 {
140 __u32 sa_handler; /* pointer */
141 __u32 sa_flags;
142 __u32 sa_restorer; /* pointer */
143 compat_sigset_t sa_mask; /* mask last for extensibility */
146 typedef struct {
147 __u32 ss_sp; /* pointer */
148 int ss_flags;
149 compat_size_t ss_size;
150 } stack_t32;
152 /* asm/ucontext.h */
153 struct ucontext32 {
154 __u32 uc_flags;
155 __u32 uc_link; /* pointer */
156 stack_t32 uc_stack;
157 _sigregs32 uc_mcontext;
158 compat_sigset_t uc_sigmask; /* mask last for extensibility */
161 struct stat64_emu31;
162 struct mmap_arg_struct_emu31;
163 struct fadvise64_64_args;
164 struct old_sigaction32;
165 struct old_sigaction32;
167 long sys32_chown16(const char __user * filename, u16 user, u16 group);
168 long sys32_lchown16(const char __user * filename, u16 user, u16 group);
169 long sys32_fchown16(unsigned int fd, u16 user, u16 group);
170 long sys32_setregid16(u16 rgid, u16 egid);
171 long sys32_setgid16(u16 gid);
172 long sys32_setreuid16(u16 ruid, u16 euid);
173 long sys32_setuid16(u16 uid);
174 long sys32_setresuid16(u16 ruid, u16 euid, u16 suid);
175 long sys32_getresuid16(u16 __user *ruid, u16 __user *euid, u16 __user *suid);
176 long sys32_setresgid16(u16 rgid, u16 egid, u16 sgid);
177 long sys32_getresgid16(u16 __user *rgid, u16 __user *egid, u16 __user *sgid);
178 long sys32_setfsuid16(u16 uid);
179 long sys32_setfsgid16(u16 gid);
180 long sys32_getgroups16(int gidsetsize, u16 __user *grouplist);
181 long sys32_setgroups16(int gidsetsize, u16 __user *grouplist);
182 long sys32_getuid16(void);
183 long sys32_geteuid16(void);
184 long sys32_getgid16(void);
185 long sys32_getegid16(void);
186 long sys32_ipc(u32 call, int first, int second, int third, u32 ptr);
187 long sys32_truncate64(const char __user * path, unsigned long high,
188 unsigned long low);
189 long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned long low);
190 long sys32_sched_rr_get_interval(compat_pid_t pid,
191 struct compat_timespec __user *interval);
192 long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
193 compat_sigset_t __user *oset, size_t sigsetsize);
194 long sys32_rt_sigpending(compat_sigset_t __user *set, size_t sigsetsize);
195 long sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo);
196 long sys32_execve(const char __user *name, compat_uptr_t __user *argv,
197 compat_uptr_t __user *envp);
198 long sys32_init_module(void __user *umod, unsigned long len,
199 const char __user *uargs);
200 long sys32_delete_module(const char __user *name_user, unsigned int flags);
201 long sys32_pread64(unsigned int fd, char __user *ubuf, size_t count,
202 u32 poshi, u32 poslo);
203 long sys32_pwrite64(unsigned int fd, const char __user *ubuf,
204 size_t count, u32 poshi, u32 poslo);
205 compat_ssize_t sys32_readahead(int fd, u32 offhi, u32 offlo, s32 count);
206 long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset,
207 size_t count);
208 long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset,
209 s32 count);
210 long sys32_stat64(const char __user * filename, struct stat64_emu31 __user * statbuf);
211 long sys32_lstat64(const char __user * filename,
212 struct stat64_emu31 __user * statbuf);
213 long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * statbuf);
214 long sys32_fstatat64(unsigned int dfd, const char __user *filename,
215 struct stat64_emu31 __user* statbuf, int flag);
216 unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg);
217 long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg);
218 long sys32_read(unsigned int fd, char __user * buf, size_t count);
219 long sys32_write(unsigned int fd, const char __user * buf, size_t count);
220 long sys32_fadvise64(int fd, loff_t offset, size_t len, int advise);
221 long sys32_fadvise64_64(struct fadvise64_64_args __user *args);
222 long sys32_sigaction(int sig, const struct old_sigaction32 __user *act,
223 struct old_sigaction32 __user *oact);
224 long sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
225 struct sigaction32 __user *oact, size_t sigsetsize);
226 long sys32_sigaltstack(const stack_t32 __user *uss, stack_t32 __user *uoss);
227 #endif /* _ASM_S390X_S390_H */