compat_linux.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #ifndef _ASM_S390X_S390_H
  2. #define _ASM_S390X_S390_H
  3. #include <linux/compat.h>
  4. #include <linux/socket.h>
  5. #include <linux/syscalls.h>
  6. /* Macro that masks the high order bit of an 32 bit pointer and converts it*/
  7. /* to a 64 bit pointer */
  8. #define A(__x) ((unsigned long)((__x) & 0x7FFFFFFFUL))
  9. #define AA(__x) \
  10. ((unsigned long)(__x))
  11. /* Now 32bit compatibility types */
  12. struct ipc_kludge_32 {
  13. __u32 msgp; /* pointer */
  14. __s32 msgtyp;
  15. };
  16. /* asm/sigcontext.h */
  17. typedef union
  18. {
  19. __u64 d;
  20. __u32 f;
  21. } freg_t32;
  22. typedef struct
  23. {
  24. unsigned int fpc;
  25. unsigned int pad;
  26. freg_t32 fprs[__NUM_FPRS];
  27. } _s390_fp_regs32;
  28. typedef struct
  29. {
  30. __u32 mask;
  31. __u32 addr;
  32. } _psw_t32 __attribute__ ((aligned(8)));
  33. typedef struct
  34. {
  35. _psw_t32 psw;
  36. __u32 gprs[__NUM_GPRS];
  37. __u32 acrs[__NUM_ACRS];
  38. } _s390_regs_common32;
  39. typedef struct
  40. {
  41. _s390_regs_common32 regs;
  42. _s390_fp_regs32 fpregs;
  43. } _sigregs32;
  44. typedef struct
  45. {
  46. __u32 gprs_high[__NUM_GPRS];
  47. __u64 vxrs_low[__NUM_VXRS_LOW];
  48. __vector128 vxrs_high[__NUM_VXRS_HIGH];
  49. __u8 __reserved[128];
  50. } _sigregs_ext32;
  51. #define _SIGCONTEXT_NSIG32 64
  52. #define _SIGCONTEXT_NSIG_BPW32 32
  53. #define __SIGNAL_FRAMESIZE32 96
  54. #define _SIGMASK_COPY_SIZE32 (sizeof(u32)*2)
  55. struct sigcontext32
  56. {
  57. __u32 oldmask[_COMPAT_NSIG_WORDS];
  58. __u32 sregs; /* pointer */
  59. };
  60. /* asm/signal.h */
  61. /* asm/ucontext.h */
  62. struct ucontext32 {
  63. __u32 uc_flags;
  64. __u32 uc_link; /* pointer */
  65. compat_stack_t uc_stack;
  66. _sigregs32 uc_mcontext;
  67. compat_sigset_t uc_sigmask;
  68. /* Allow for uc_sigmask growth. Glibc uses a 1024-bit sigset_t. */
  69. unsigned char __unused[128 - sizeof(compat_sigset_t)];
  70. _sigregs_ext32 uc_mcontext_ext;
  71. };
  72. struct stat64_emu31;
  73. struct mmap_arg_struct_emu31;
  74. struct fadvise64_64_args;
  75. long compat_sys_s390_chown16(const char __user *filename, u16 user, u16 group);
  76. long compat_sys_s390_lchown16(const char __user *filename, u16 user, u16 group);
  77. long compat_sys_s390_fchown16(unsigned int fd, u16 user, u16 group);
  78. long compat_sys_s390_setregid16(u16 rgid, u16 egid);
  79. long compat_sys_s390_setgid16(u16 gid);
  80. long compat_sys_s390_setreuid16(u16 ruid, u16 euid);
  81. long compat_sys_s390_setuid16(u16 uid);
  82. long compat_sys_s390_setresuid16(u16 ruid, u16 euid, u16 suid);
  83. long compat_sys_s390_getresuid16(u16 __user *ruid, u16 __user *euid, u16 __user *suid);
  84. long compat_sys_s390_setresgid16(u16 rgid, u16 egid, u16 sgid);
  85. long compat_sys_s390_getresgid16(u16 __user *rgid, u16 __user *egid, u16 __user *sgid);
  86. long compat_sys_s390_setfsuid16(u16 uid);
  87. long compat_sys_s390_setfsgid16(u16 gid);
  88. long compat_sys_s390_getgroups16(int gidsetsize, u16 __user *grouplist);
  89. long compat_sys_s390_setgroups16(int gidsetsize, u16 __user *grouplist);
  90. long compat_sys_s390_getuid16(void);
  91. long compat_sys_s390_geteuid16(void);
  92. long compat_sys_s390_getgid16(void);
  93. long compat_sys_s390_getegid16(void);
  94. long compat_sys_s390_truncate64(const char __user *path, u32 high, u32 low);
  95. long compat_sys_s390_ftruncate64(unsigned int fd, u32 high, u32 low);
  96. long compat_sys_s390_pread64(unsigned int fd, char __user *ubuf, compat_size_t count, u32 high, u32 low);
  97. long compat_sys_s390_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count, u32 high, u32 low);
  98. long compat_sys_s390_readahead(int fd, u32 high, u32 low, s32 count);
  99. long compat_sys_s390_stat64(const char __user *filename, struct stat64_emu31 __user *statbuf);
  100. long compat_sys_s390_lstat64(const char __user *filename, struct stat64_emu31 __user *statbuf);
  101. long compat_sys_s390_fstat64(unsigned int fd, struct stat64_emu31 __user *statbuf);
  102. long compat_sys_s390_fstatat64(unsigned int dfd, const char __user *filename, struct stat64_emu31 __user *statbuf, int flag);
  103. long compat_sys_s390_old_mmap(struct mmap_arg_struct_emu31 __user *arg);
  104. long compat_sys_s390_mmap2(struct mmap_arg_struct_emu31 __user *arg);
  105. long compat_sys_s390_read(unsigned int fd, char __user * buf, compat_size_t count);
  106. long compat_sys_s390_write(unsigned int fd, const char __user * buf, compat_size_t count);
  107. long compat_sys_s390_fadvise64(int fd, u32 high, u32 low, compat_size_t len, int advise);
  108. long compat_sys_s390_fadvise64_64(struct fadvise64_64_args __user *args);
  109. long compat_sys_s390_sync_file_range(int fd, u32 offhigh, u32 offlow, u32 nhigh, u32 nlow, unsigned int flags);
  110. long compat_sys_s390_fallocate(int fd, int mode, u32 offhigh, u32 offlow, u32 lenhigh, u32 lenlow);
  111. long compat_sys_sigreturn(void);
  112. long compat_sys_rt_sigreturn(void);
  113. #endif /* _ASM_S390X_S390_H */