aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2005-02-16 16:25:03 -0500
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 14:30:37 -0400
commitd1abb6a2b8b57fa14ae0f69d4a3cb07ff9cdb8d1 (patch)
tree9bb086547b131b55dfaef22a7592f9d66a5db150 /arch/mips/kernel
parenta982099ca5465dd848d8ae28a83a3e49ac7b612b (diff)
32-bit compatibility for various timer-related system calls.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/linux32.c50
-rw-r--r--arch/mips/kernel/scall64-n32.S18
-rw-r--r--arch/mips/kernel/scall64-o32.S2
3 files changed, 60 insertions, 10 deletions
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 120dd897162e..e8e886dd52d6 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -1418,3 +1418,53 @@ asmlinkage long sys32_socketcall(int call, unsigned int *args32)
1418 } 1418 }
1419 return err; 1419 return err;
1420} 1420}
1421
1422struct sigevent32 {
1423 u32 sigev_value;
1424 u32 sigev_signo;
1425 u32 sigev_notify;
1426 u32 payload[(64 / 4) - 3];
1427};
1428
1429extern asmlinkage long
1430sys_timer_create(clockid_t which_clock,
1431 struct sigevent __user *timer_event_spec,
1432 timer_t __user * created_timer_id);
1433
1434long
1435sys32_timer_create(u32 clock, struct sigevent32 __user *se32, timer_t __user *timer_id)
1436{
1437 struct sigevent __user *p = NULL;
1438 if (se32) {
1439 struct sigevent se;
1440 p = compat_alloc_user_space(sizeof(struct sigevent));
1441 memset(&se, 0, sizeof(struct sigevent));
1442 if (get_user(se.sigev_value.sival_int, &se32->sigev_value) ||
1443 __get_user(se.sigev_signo, &se32->sigev_signo) ||
1444 __get_user(se.sigev_notify, &se32->sigev_notify) ||
1445 __copy_from_user(&se._sigev_un._pad, &se32->payload,
1446 sizeof(se32->payload)) ||
1447 copy_to_user(p, &se, sizeof(se)))
1448 return -EFAULT;
1449 }
1450 return sys_timer_create(clock, p, timer_id);
1451}
1452
1453asmlinkage long
1454sysn32_rt_sigtimedwait(const sigset_t __user *uthese,
1455 siginfo_t __user *uinfo,
1456 const struct compat_timespec __user *uts32,
1457 size_t sigsetsize)
1458{
1459 struct timespec __user *uts = NULL;
1460
1461 if (uts32) {
1462 struct timespec ts;
1463 uts = compat_alloc_user_space(sizeof(struct timespec));
1464 if (get_user(ts.tv_sec, &uts32->tv_sec) ||
1465 get_user(ts.tv_nsec, &uts32->tv_nsec) ||
1466 copy_to_user (uts, &ts, sizeof (ts)))
1467 return -EFAULT;
1468 }
1469 return sys_rt_sigtimedwait(uthese, uinfo, uts, sigsetsize);
1470}
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 982248a17393..e797f15bc0f0 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -243,8 +243,8 @@ EXPORT(sysn32_call_table)
243 PTR sys_capget 243 PTR sys_capget
244 PTR sys_capset 244 PTR sys_capset
245 PTR sys32_rt_sigpending /* 6125 */ 245 PTR sys32_rt_sigpending /* 6125 */
246 PTR compat_sys_rt_sigtimedwait 246 PTR sysn32_rt_sigtimedwait
247 PTR sys32_rt_sigqueueinfo 247 PTR sys_rt_sigqueueinfo
248 PTR sys32_rt_sigsuspend 248 PTR sys32_rt_sigsuspend
249 PTR sys32_sigaltstack 249 PTR sys32_sigaltstack
250 PTR compat_sys_utime /* 6130 */ 250 PTR compat_sys_utime /* 6130 */
@@ -337,15 +337,15 @@ EXPORT(sysn32_call_table)
337 PTR compat_sys_statfs64 337 PTR compat_sys_statfs64
338 PTR compat_sys_fstatfs64 338 PTR compat_sys_fstatfs64
339 PTR sys_sendfile64 339 PTR sys_sendfile64
340 PTR sys_timer_create /* 6220 */ 340 PTR sys32_timer_create /* 6220 */
341 PTR sys_timer_settime 341 PTR compat_sys_timer_settime
342 PTR sys_timer_gettime 342 PTR compat_sys_timer_gettime
343 PTR sys_timer_getoverrun 343 PTR sys_timer_getoverrun
344 PTR sys_timer_delete 344 PTR sys_timer_delete
345 PTR sys_clock_settime /* 6225 */ 345 PTR compat_sys_clock_settime /* 6225 */
346 PTR sys_clock_gettime 346 PTR compat_sys_clock_gettime
347 PTR sys_clock_getres 347 PTR compat_sys_clock_getres
348 PTR sys_clock_nanosleep 348 PTR compat_sys_clock_nanosleep
349 PTR sys_tgkill 349 PTR sys_tgkill
350 PTR compat_sys_utimes /* 6230 */ 350 PTR compat_sys_utimes /* 6230 */
351 PTR sys_ni_syscall /* sys_mbind */ 351 PTR sys_ni_syscall /* sys_mbind */
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 00e0d2b8fd8e..1017176bdce9 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -459,7 +459,7 @@ sys_call_table:
459 PTR sys_fadvise64_64 459 PTR sys_fadvise64_64
460 PTR compat_sys_statfs64 /* 4255 */ 460 PTR compat_sys_statfs64 /* 4255 */
461 PTR compat_sys_fstatfs64 461 PTR compat_sys_fstatfs64
462 PTR sys_timer_create 462 PTR sys32_timer_create
463 PTR compat_sys_timer_settime 463 PTR compat_sys_timer_settime
464 PTR compat_sys_timer_gettime 464 PTR compat_sys_timer_gettime
465 PTR sys_timer_getoverrun /* 4260 */ 465 PTR sys_timer_getoverrun /* 4260 */