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