compat_linux.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_S390X_S390_H
  3. #define _ASM_S390X_S390_H
  4. #include <linux/compat.h>
  5. #include <linux/socket.h>
  6. #include <linux/syscalls.h>
  7. #include <asm/ptrace.h>
  8. /*
  9. * Macro that masks the high order bit of a 32 bit pointer and
  10. * converts it to a 64 bit pointer.
  11. */
  12. #define A(__x) ((unsigned long)((__x) & 0x7FFFFFFFUL))
  13. #define AA(__x) ((unsigned long)(__x))
  14. /* Now 32bit compatibility types */
  15. struct ipc_kludge_32 {
  16. __u32 msgp; /* pointer */
  17. __s32 msgtyp;
  18. };
  19. /* asm/sigcontext.h */
  20. typedef union {
  21. __u64 d;
  22. __u32 f;
  23. } freg_t32;
  24. typedef struct {
  25. unsigned int fpc;
  26. unsigned int pad;
  27. freg_t32 fprs[__NUM_FPRS];
  28. } _s390_fp_regs32;
  29. typedef struct {
  30. psw_t32 psw;
  31. __u32 gprs[__NUM_GPRS];
  32. __u32 acrs[__NUM_ACRS];
  33. } _s390_regs_common32;
  34. typedef struct {
  35. _s390_regs_common32 regs;
  36. _s390_fp_regs32 fpregs;
  37. } _sigregs32;
  38. typedef struct {
  39. __u32 gprs_high[__NUM_GPRS];
  40. __u64 vxrs_low[__NUM_VXRS_LOW];
  41. __vector128 vxrs_high[__NUM_VXRS_HIGH];
  42. __u8 __reserved[128];
  43. } _sigregs_ext32;
  44. #define _SIGCONTEXT_NSIG32 64
  45. #define _SIGCONTEXT_NSIG_BPW32 32
  46. #define __SIGNAL_FRAMESIZE32 96
  47. #define _SIGMASK_COPY_SIZE32 (sizeof(u32) * 2)
  48. struct sigcontext32 {
  49. __u32 oldmask[_COMPAT_NSIG_WORDS];
  50. __u32 sregs; /* pointer */
  51. };
  52. /* asm/signal.h */
  53. /* asm/ucontext.h */
  54. struct ucontext32 {
  55. __u32 uc_flags;
  56. __u32 uc_link; /* pointer */
  57. compat_stack_t uc_stack;
  58. _sigregs32 uc_mcontext;
  59. compat_sigset_t uc_sigmask;
  60. /* Allow for uc_sigmask growth. Glibc uses a 1024-bit sigset_t. */
  61. unsigned char __unused[128 - sizeof(compat_sigset_t)];
  62. _sigregs_ext32 uc_mcontext_ext;
  63. };
  64. struct stat64_emu31;
  65. struct mmap_arg_struct_emu31;
  66. struct fadvise64_64_args;
  67. long compat_sys_s390_truncate64(const char __user *path, u32 high, u32 low);
  68. long compat_sys_s390_ftruncate64(unsigned int fd, u32 high, u32 low);
  69. long compat_sys_s390_pread64(unsigned int fd, char __user *ubuf, compat_size_t count, u32 high, u32 low);
  70. long compat_sys_s390_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count, u32 high, u32 low);
  71. long compat_sys_s390_readahead(int fd, u32 high, u32 low, s32 count);
  72. long compat_sys_s390_stat64(const char __user *filename, struct stat64_emu31 __user *statbuf);
  73. long compat_sys_s390_lstat64(const char __user *filename, struct stat64_emu31 __user *statbuf);
  74. long compat_sys_s390_fstat64(unsigned int fd, struct stat64_emu31 __user *statbuf);
  75. long compat_sys_s390_fstatat64(unsigned int dfd, const char __user *filename, struct stat64_emu31 __user *statbuf, int flag);
  76. long compat_sys_s390_old_mmap(struct mmap_arg_struct_emu31 __user *arg);
  77. long compat_sys_s390_mmap2(struct mmap_arg_struct_emu31 __user *arg);
  78. long compat_sys_s390_read(unsigned int fd, char __user *buf, compat_size_t count);
  79. long compat_sys_s390_write(unsigned int fd, const char __user *buf, compat_size_t count);
  80. long compat_sys_s390_fadvise64(int fd, u32 high, u32 low, compat_size_t len, int advise);
  81. long compat_sys_s390_fadvise64_64(struct fadvise64_64_args __user *args);
  82. long compat_sys_s390_sync_file_range(int fd, u32 offhigh, u32 offlow, u32 nhigh, u32 nlow, unsigned int flags);
  83. long compat_sys_s390_fallocate(int fd, int mode, u32 offhigh, u32 offlow, u32 lenhigh, u32 lenlow);
  84. long compat_sys_sigreturn(void);
  85. long compat_sys_rt_sigreturn(void);
  86. #endif /* _ASM_S390X_S390_H */