1
2
3
4
5
6
7
8
9
10
11
12
13
14#include <linux/errno.h>
15#include <linux/sched.h>
16#include <linux/mm.h>
17#include <linux/fs.h>
18#include <linux/smp.h>
19#include <linux/sem.h>
20#include <linux/msg.h>
21#include <linux/shm.h>
22#include <linux/stat.h>
23#include <linux/syscalls.h>
24#include <linux/mman.h>
25#include <linux/file.h>
26#include <linux/utsname.h>
27#include <linux/personality.h>
28#include <linux/unistd.h>
29#include <linux/ipc.h>
30#include <asm/uaccess.h>
31#include "entry.h"
32
33
34
35
36
37
38
39struct s390_mmap_arg_struct {
40 unsigned long addr;
41 unsigned long len;
42 unsigned long prot;
43 unsigned long flags;
44 unsigned long fd;
45 unsigned long offset;
46};
47
48SYSCALL_DEFINE1(mmap2, struct s390_mmap_arg_struct __user *, arg)
49{
50 struct s390_mmap_arg_struct a;
51 int error = -EFAULT;
52
53 if (copy_from_user(&a, arg, sizeof(a)))
54 goto out;
55 error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset);
56out:
57 return error;
58}
59
60
61
62
63SYSCALL_DEFINE5(s390_ipc, uint, call, int, first, unsigned long, second,
64 unsigned long, third, void __user *, ptr)
65{
66 if (call >> 16)
67 return -EINVAL;
68
69
70
71
72
73
74
75
76 return sys_ipc(call, first, second, third, ptr, third);
77}
78
79#ifdef CONFIG_64BIT
80SYSCALL_DEFINE1(s390_personality, unsigned int, personality)
81{
82 unsigned int ret;
83
84 if (personality(current->personality) == PER_LINUX32 &&
85 personality(personality) == PER_LINUX)
86 personality |= PER_LINUX32;
87 ret = sys_personality(personality);
88 if (personality(ret) == PER_LINUX32)
89 ret &= ~PER_LINUX32;
90
91 return ret;
92}
93#endif
94
95
96
97
98#ifndef CONFIG_64BIT
99
100SYSCALL_DEFINE5(s390_fadvise64, int, fd, u32, offset_high, u32, offset_low,
101 size_t, len, int, advice)
102{
103 return sys_fadvise64(fd, (u64) offset_high << 32 | offset_low,
104 len, advice);
105}
106
107struct fadvise64_64_args {
108 int fd;
109 long long offset;
110 long long len;
111 int advice;
112};
113
114SYSCALL_DEFINE1(s390_fadvise64_64, struct fadvise64_64_args __user *, args)
115{
116 struct fadvise64_64_args a;
117
118 if ( copy_from_user(&a, args, sizeof(a)) )
119 return -EFAULT;
120 return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice);
121}
122
123
124
125
126
127
128
129
130
131
132
133
134
135SYSCALL_DEFINE5(s390_fallocate, int, fd, int, mode, loff_t, offset,
136 u32, len_high, u32, len_low)
137{
138 return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low);
139}
140#endif
141