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