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