aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/Kconfig1
-rw-r--r--arch/mips/include/asm/linkage.h3
-rw-r--r--arch/mips/include/asm/unistd.h8
-rw-r--r--arch/mips/kernel/linux32.c119
-rw-r--r--arch/mips/kernel/scall64-n32.S8
-rw-r--r--arch/mips/kernel/scall64-o32.S6
6 files changed, 10 insertions, 135 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 007a917a980d..e5f3794744f1 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1739,7 +1739,6 @@ config 32BIT
1739config 64BIT 1739config 64BIT
1740 bool "64-bit kernel" 1740 bool "64-bit kernel"
1741 depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL 1741 depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL
1742 select HAVE_SYSCALL_WRAPPERS
1743 help 1742 help
1744 Select this option if you want to build a 64-bit kernel. 1743 Select this option if you want to build a 64-bit kernel.
1745 1744
diff --git a/arch/mips/include/asm/linkage.h b/arch/mips/include/asm/linkage.h
index e9a940d1b0c6..2767dda9e309 100644
--- a/arch/mips/include/asm/linkage.h
+++ b/arch/mips/include/asm/linkage.h
@@ -6,5 +6,8 @@
6#endif 6#endif
7 7
8#define __weak __attribute__((weak)) 8#define __weak __attribute__((weak))
9#define cond_syscall(x) asm(".weak\t" #x "\n" #x "\t=\tsys_ni_syscall")
10#define SYSCALL_ALIAS(alias, name) \
11 asm ( #alias " = " #name "\n\t.globl " #alias)
9 12
10#endif 13#endif
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h
index 64f661e32879..63c9c886173a 100644
--- a/arch/mips/include/asm/unistd.h
+++ b/arch/mips/include/asm/unistd.h
@@ -63,12 +63,4 @@
63 63
64#endif /* !__ASSEMBLY__ */ 64#endif /* !__ASSEMBLY__ */
65 65
66/*
67 * "Conditional" syscalls
68 *
69 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
70 * but it doesn't work on all toolchains, so we just do it by hand
71 */
72#define cond_syscall(x) asm(".weak\t" #x "\n" #x "\t=\tsys_ni_syscall")
73
74#endif /* _ASM_UNISTD_H */ 66#endif /* _ASM_UNISTD_H */
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index db9655f08892..d1d576b765f5 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -119,99 +119,6 @@ SYSCALL_DEFINE6(32_pwrite, unsigned int, fd, const char __user *, buf,
119 return sys_pwrite64(fd, buf, count, merge_64(a4, a5)); 119 return sys_pwrite64(fd, buf, count, merge_64(a4, a5));
120} 120}
121 121
122#ifdef CONFIG_SYSVIPC
123
124SYSCALL_DEFINE6(32_ipc, u32, call, long, first, long, second, long, third,
125 unsigned long, ptr, unsigned long, fifth)
126{
127 int version, err;
128
129 version = call >> 16; /* hack for backward compatibility */
130 call &= 0xffff;
131
132 switch (call) {
133 case SEMOP:
134 /* struct sembuf is the same on 32 and 64bit :)) */
135 err = sys_semtimedop(first, compat_ptr(ptr), second, NULL);
136 break;
137 case SEMTIMEDOP:
138 err = compat_sys_semtimedop(first, compat_ptr(ptr), second,
139 compat_ptr(fifth));
140 break;
141 case SEMGET:
142 err = sys_semget(first, second, third);
143 break;
144 case SEMCTL:
145 err = compat_sys_semctl(first, second, third, compat_ptr(ptr));
146 break;
147 case MSGSND:
148 err = compat_sys_msgsnd(first, second, third, compat_ptr(ptr));
149 break;
150 case MSGRCV:
151 err = compat_sys_msgrcv(first, second, fifth, third,
152 version, compat_ptr(ptr));
153 break;
154 case MSGGET:
155 err = sys_msgget((key_t) first, second);
156 break;
157 case MSGCTL:
158 err = compat_sys_msgctl(first, second, compat_ptr(ptr));
159 break;
160 case SHMAT:
161 err = compat_sys_shmat(first, second, third, version,
162 compat_ptr(ptr));
163 break;
164 case SHMDT:
165 err = sys_shmdt(compat_ptr(ptr));
166 break;
167 case SHMGET:
168 err = sys_shmget(first, (unsigned)second, third);
169 break;
170 case SHMCTL:
171 err = compat_sys_shmctl(first, second, compat_ptr(ptr));
172 break;
173 default:
174 err = -ENOSYS;
175 break;
176 }
177
178 return err;
179}
180
181#else
182
183SYSCALL_DEFINE6(32_ipc, u32, call, int, first, int, second, int, third,
184 u32, ptr, u32, fifth)
185{
186 return -ENOSYS;
187}
188
189#endif /* CONFIG_SYSVIPC */
190
191#ifdef CONFIG_MIPS32_N32
192SYSCALL_DEFINE4(n32_semctl, int, semid, int, semnum, int, cmd, u32, arg)
193{
194 /* compat_sys_semctl expects a pointer to union semun */
195 u32 __user *uptr = compat_alloc_user_space(sizeof(u32));
196 if (put_user(arg, uptr))
197 return -EFAULT;
198 return compat_sys_semctl(semid, semnum, cmd, uptr);
199}
200
201SYSCALL_DEFINE4(n32_msgsnd, int, msqid, u32, msgp, unsigned int, msgsz,
202 int, msgflg)
203{
204 return compat_sys_msgsnd(msqid, msgsz, msgflg, compat_ptr(msgp));
205}
206
207SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz,
208 int, msgtyp, int, msgflg)
209{
210 return compat_sys_msgrcv(msqid, msgsz, msgtyp, msgflg, IPC_64,
211 compat_ptr(msgp));
212}
213#endif
214
215SYSCALL_DEFINE1(32_personality, unsigned long, personality) 122SYSCALL_DEFINE1(32_personality, unsigned long, personality)
216{ 123{
217 unsigned int p = personality & 0xffffffff; 124 unsigned int p = personality & 0xffffffff;
@@ -226,26 +133,6 @@ SYSCALL_DEFINE1(32_personality, unsigned long, personality)
226 return ret; 133 return ret;
227} 134}
228 135
229SYSCALL_DEFINE4(32_sendfile, long, out_fd, long, in_fd,
230 compat_off_t __user *, offset, s32, count)
231{
232 mm_segment_t old_fs = get_fs();
233 int ret;
234 off_t of;
235
236 if (offset && get_user(of, offset))
237 return -EFAULT;
238
239 set_fs(KERNEL_DS);
240 ret = sys_sendfile(out_fd, in_fd, offset ? (off_t __user *)&of : NULL, count);
241 set_fs(old_fs);
242
243 if (offset && put_user(of, offset))
244 return -EFAULT;
245
246 return ret;
247}
248
249asmlinkage ssize_t sys32_readahead(int fd, u32 pad0, u64 a2, u64 a3, 136asmlinkage ssize_t sys32_readahead(int fd, u32 pad0, u64 a2, u64 a3,
250 size_t count) 137 size_t count)
251{ 138{
@@ -279,12 +166,6 @@ asmlinkage long sys32_fallocate(int fd, int mode, unsigned offset_a2,
279 merge_64(len_a4, len_a5)); 166 merge_64(len_a4, len_a5));
280} 167}
281 168
282asmlinkage long sys32_lookup_dcookie(u32 a0, u32 a1, char __user *buf,
283 size_t len)
284{
285 return sys_lookup_dcookie(merge_64(a0, a1), buf, len);
286}
287
288SYSCALL_DEFINE6(32_fanotify_mark, int, fanotify_fd, unsigned int, flags, 169SYSCALL_DEFINE6(32_fanotify_mark, int, fanotify_fd, unsigned int, flags,
289 u64, a3, u64, a4, int, dfd, const char __user *, pathname) 170 u64, a3, u64, a4, int, dfd, const char __user *, pathname)
290{ 171{
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 693d60b0855f..edcb6594e7b5 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -143,7 +143,7 @@ EXPORT(sysn32_call_table)
143 PTR compat_sys_setitimer 143 PTR compat_sys_setitimer
144 PTR sys_alarm 144 PTR sys_alarm
145 PTR sys_getpid 145 PTR sys_getpid
146 PTR sys_32_sendfile 146 PTR compat_sys_sendfile
147 PTR sys_socket /* 6040 */ 147 PTR sys_socket /* 6040 */
148 PTR sys_connect 148 PTR sys_connect
149 PTR sys_accept 149 PTR sys_accept
@@ -168,11 +168,11 @@ EXPORT(sysn32_call_table)
168 PTR sys_newuname 168 PTR sys_newuname
169 PTR sys_semget 169 PTR sys_semget
170 PTR sys_semop 170 PTR sys_semop
171 PTR sys_n32_semctl 171 PTR compat_sys_semctl
172 PTR sys_shmdt /* 6065 */ 172 PTR sys_shmdt /* 6065 */
173 PTR sys_msgget 173 PTR sys_msgget
174 PTR sys_n32_msgsnd 174 PTR compat_sys_msgsnd
175 PTR sys_n32_msgrcv 175 PTR compat_sys_msgrcv
176 PTR compat_sys_msgctl 176 PTR compat_sys_msgctl
177 PTR compat_sys_fcntl /* 6070 */ 177 PTR compat_sys_fcntl /* 6070 */
178 PTR sys_flock 178 PTR sys_flock
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index af8887f779f1..103bfe570fe8 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -309,7 +309,7 @@ sys_call_table:
309 PTR compat_sys_wait4 309 PTR compat_sys_wait4
310 PTR sys_swapoff /* 4115 */ 310 PTR sys_swapoff /* 4115 */
311 PTR compat_sys_sysinfo 311 PTR compat_sys_sysinfo
312 PTR sys_32_ipc 312 PTR compat_sys_ipc
313 PTR sys_fsync 313 PTR sys_fsync
314 PTR sys32_sigreturn 314 PTR sys32_sigreturn
315 PTR __sys_clone /* 4120 */ 315 PTR __sys_clone /* 4120 */
@@ -399,7 +399,7 @@ sys_call_table:
399 PTR sys_capget 399 PTR sys_capget
400 PTR sys_capset /* 4205 */ 400 PTR sys_capset /* 4205 */
401 PTR compat_sys_sigaltstack 401 PTR compat_sys_sigaltstack
402 PTR sys_32_sendfile 402 PTR compat_sys_sendfile
403 PTR sys_ni_syscall 403 PTR sys_ni_syscall
404 PTR sys_ni_syscall 404 PTR sys_ni_syscall
405 PTR sys_mips_mmap2 /* 4210 */ 405 PTR sys_mips_mmap2 /* 4210 */
@@ -439,7 +439,7 @@ sys_call_table:
439 PTR compat_sys_io_submit 439 PTR compat_sys_io_submit
440 PTR sys_io_cancel /* 4245 */ 440 PTR sys_io_cancel /* 4245 */
441 PTR sys_exit_group 441 PTR sys_exit_group
442 PTR sys32_lookup_dcookie 442 PTR compat_sys_lookup_dcookie
443 PTR sys_epoll_create 443 PTR sys_epoll_create
444 PTR sys_epoll_ctl 444 PTR sys_epoll_ctl
445 PTR sys_epoll_wait /* 4250 */ 445 PTR sys_epoll_wait /* 4250 */