diff options
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/linux32.c | 61 | ||||
-rw-r--r-- | arch/mips/kernel/scall32-o32.S | 1 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-64.S | 1 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-n32.S | 3 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-o32.S | 3 | ||||
-rw-r--r-- | arch/mips/kernel/syscall.c | 4 |
6 files changed, 10 insertions, 63 deletions
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index b77fefaff9d..1a2793efdc4 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
@@ -265,67 +265,6 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz, | |||
265 | } | 265 | } |
266 | #endif | 266 | #endif |
267 | 267 | ||
268 | struct sysctl_args32 | ||
269 | { | ||
270 | compat_caddr_t name; | ||
271 | int nlen; | ||
272 | compat_caddr_t oldval; | ||
273 | compat_caddr_t oldlenp; | ||
274 | compat_caddr_t newval; | ||
275 | compat_size_t newlen; | ||
276 | unsigned int __unused[4]; | ||
277 | }; | ||
278 | |||
279 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
280 | |||
281 | SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args) | ||
282 | { | ||
283 | struct sysctl_args32 tmp; | ||
284 | int error; | ||
285 | size_t oldlen; | ||
286 | size_t __user *oldlenp = NULL; | ||
287 | unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7; | ||
288 | |||
289 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
290 | return -EFAULT; | ||
291 | |||
292 | if (tmp.oldval && tmp.oldlenp) { | ||
293 | /* Duh, this is ugly and might not work if sysctl_args | ||
294 | is in read-only memory, but do_sysctl does indirectly | ||
295 | a lot of uaccess in both directions and we'd have to | ||
296 | basically copy the whole sysctl.c here, and | ||
297 | glibc's __sysctl uses rw memory for the structure | ||
298 | anyway. */ | ||
299 | if (get_user(oldlen, (u32 __user *)A(tmp.oldlenp)) || | ||
300 | put_user(oldlen, (size_t __user *)addr)) | ||
301 | return -EFAULT; | ||
302 | oldlenp = (size_t __user *)addr; | ||
303 | } | ||
304 | |||
305 | lock_kernel(); | ||
306 | error = do_sysctl((int __user *)A(tmp.name), tmp.nlen, (void __user *)A(tmp.oldval), | ||
307 | oldlenp, (void __user *)A(tmp.newval), tmp.newlen); | ||
308 | unlock_kernel(); | ||
309 | if (oldlenp) { | ||
310 | if (!error) { | ||
311 | if (get_user(oldlen, (size_t __user *)addr) || | ||
312 | put_user(oldlen, (u32 __user *)A(tmp.oldlenp))) | ||
313 | error = -EFAULT; | ||
314 | } | ||
315 | copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)); | ||
316 | } | ||
317 | return error; | ||
318 | } | ||
319 | |||
320 | #else | ||
321 | |||
322 | SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args) | ||
323 | { | ||
324 | return -ENOSYS; | ||
325 | } | ||
326 | |||
327 | #endif /* CONFIG_SYSCTL_SYSCALL */ | ||
328 | |||
329 | SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name) | 268 | SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name) |
330 | { | 269 | { |
331 | int ret = 0; | 270 | int ret = 0; |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index fd2a9bb620d..17202bbe843 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -583,6 +583,7 @@ einval: li v0, -ENOSYS | |||
583 | sys sys_rt_tgsigqueueinfo 4 | 583 | sys sys_rt_tgsigqueueinfo 4 |
584 | sys sys_perf_event_open 5 | 584 | sys sys_perf_event_open 5 |
585 | sys sys_accept4 4 | 585 | sys sys_accept4 4 |
586 | sys sys_recvmmsg 5 | ||
586 | .endm | 587 | .endm |
587 | 588 | ||
588 | /* We pre-compute the number of _instruction_ bytes needed to | 589 | /* We pre-compute the number of _instruction_ bytes needed to |
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index 18bf7f32c5e..a8a6c596eb0 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
@@ -420,4 +420,5 @@ sys_call_table: | |||
420 | PTR sys_rt_tgsigqueueinfo | 420 | PTR sys_rt_tgsigqueueinfo |
421 | PTR sys_perf_event_open | 421 | PTR sys_perf_event_open |
422 | PTR sys_accept4 | 422 | PTR sys_accept4 |
423 | PTR sys_recvmmsg | ||
423 | .size sys_call_table,.-sys_call_table | 424 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index 6ebc0797669..66b5a48676d 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -272,7 +272,7 @@ EXPORT(sysn32_call_table) | |||
272 | PTR sys_munlockall | 272 | PTR sys_munlockall |
273 | PTR sys_vhangup /* 6150 */ | 273 | PTR sys_vhangup /* 6150 */ |
274 | PTR sys_pivot_root | 274 | PTR sys_pivot_root |
275 | PTR sys_32_sysctl | 275 | PTR compat_sys_sysctl |
276 | PTR sys_prctl | 276 | PTR sys_prctl |
277 | PTR compat_sys_adjtimex | 277 | PTR compat_sys_adjtimex |
278 | PTR compat_sys_setrlimit /* 6155 */ | 278 | PTR compat_sys_setrlimit /* 6155 */ |
@@ -418,4 +418,5 @@ EXPORT(sysn32_call_table) | |||
418 | PTR compat_sys_rt_tgsigqueueinfo /* 5295 */ | 418 | PTR compat_sys_rt_tgsigqueueinfo /* 5295 */ |
419 | PTR sys_perf_event_open | 419 | PTR sys_perf_event_open |
420 | PTR sys_accept4 | 420 | PTR sys_accept4 |
421 | PTR compat_sys_recvmmsg | ||
421 | .size sysn32_call_table,.-sysn32_call_table | 422 | .size sysn32_call_table,.-sysn32_call_table |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 14dde4ca932..515f9eab2b2 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -356,7 +356,7 @@ sys_call_table: | |||
356 | PTR sys_ni_syscall /* 4150 */ | 356 | PTR sys_ni_syscall /* 4150 */ |
357 | PTR sys_getsid | 357 | PTR sys_getsid |
358 | PTR sys_fdatasync | 358 | PTR sys_fdatasync |
359 | PTR sys_32_sysctl | 359 | PTR compat_sys_sysctl |
360 | PTR sys_mlock | 360 | PTR sys_mlock |
361 | PTR sys_munlock /* 4155 */ | 361 | PTR sys_munlock /* 4155 */ |
362 | PTR sys_mlockall | 362 | PTR sys_mlockall |
@@ -538,4 +538,5 @@ sys_call_table: | |||
538 | PTR compat_sys_rt_tgsigqueueinfo | 538 | PTR compat_sys_rt_tgsigqueueinfo |
539 | PTR sys_perf_event_open | 539 | PTR sys_perf_event_open |
540 | PTR sys_accept4 | 540 | PTR sys_accept4 |
541 | PTR compat_sys_recvmmsg | ||
541 | .size sys_call_table,.-sys_call_table | 542 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index 3fe1fcfa2e7..fe0d7980560 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c | |||
@@ -306,6 +306,7 @@ static inline int mips_atomic_set(struct pt_regs *regs, | |||
306 | 306 | ||
307 | if (cpu_has_llsc && R10000_LLSC_WAR) { | 307 | if (cpu_has_llsc && R10000_LLSC_WAR) { |
308 | __asm__ __volatile__ ( | 308 | __asm__ __volatile__ ( |
309 | " .set mips3 \n" | ||
309 | " li %[err], 0 \n" | 310 | " li %[err], 0 \n" |
310 | "1: ll %[old], (%[addr]) \n" | 311 | "1: ll %[old], (%[addr]) \n" |
311 | " move %[tmp], %[new] \n" | 312 | " move %[tmp], %[new] \n" |
@@ -320,6 +321,7 @@ static inline int mips_atomic_set(struct pt_regs *regs, | |||
320 | " "STR(PTR)" 1b, 4b \n" | 321 | " "STR(PTR)" 1b, 4b \n" |
321 | " "STR(PTR)" 2b, 4b \n" | 322 | " "STR(PTR)" 2b, 4b \n" |
322 | " .previous \n" | 323 | " .previous \n" |
324 | " .set mips0 \n" | ||
323 | : [old] "=&r" (old), | 325 | : [old] "=&r" (old), |
324 | [err] "=&r" (err), | 326 | [err] "=&r" (err), |
325 | [tmp] "=&r" (tmp) | 327 | [tmp] "=&r" (tmp) |
@@ -329,6 +331,7 @@ static inline int mips_atomic_set(struct pt_regs *regs, | |||
329 | : "memory"); | 331 | : "memory"); |
330 | } else if (cpu_has_llsc) { | 332 | } else if (cpu_has_llsc) { |
331 | __asm__ __volatile__ ( | 333 | __asm__ __volatile__ ( |
334 | " .set mips3 \n" | ||
332 | " li %[err], 0 \n" | 335 | " li %[err], 0 \n" |
333 | "1: ll %[old], (%[addr]) \n" | 336 | "1: ll %[old], (%[addr]) \n" |
334 | " move %[tmp], %[new] \n" | 337 | " move %[tmp], %[new] \n" |
@@ -347,6 +350,7 @@ static inline int mips_atomic_set(struct pt_regs *regs, | |||
347 | " "STR(PTR)" 1b, 5b \n" | 350 | " "STR(PTR)" 1b, 5b \n" |
348 | " "STR(PTR)" 2b, 5b \n" | 351 | " "STR(PTR)" 2b, 5b \n" |
349 | " .previous \n" | 352 | " .previous \n" |
353 | " .set mips0 \n" | ||
350 | : [old] "=&r" (old), | 354 | : [old] "=&r" (old), |
351 | [err] "=&r" (err), | 355 | [err] "=&r" (err), |
352 | [tmp] "=&r" (tmp) | 356 | [tmp] "=&r" (tmp) |