diff options
Diffstat (limited to 'arch/mips/kernel/linux32.c')
-rw-r--r-- | arch/mips/kernel/linux32.c | 50 |
1 files changed, 50 insertions, 0 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 | |||
1422 | struct sigevent32 { | ||
1423 | u32 sigev_value; | ||
1424 | u32 sigev_signo; | ||
1425 | u32 sigev_notify; | ||
1426 | u32 payload[(64 / 4) - 3]; | ||
1427 | }; | ||
1428 | |||
1429 | extern asmlinkage long | ||
1430 | sys_timer_create(clockid_t which_clock, | ||
1431 | struct sigevent __user *timer_event_spec, | ||
1432 | timer_t __user * created_timer_id); | ||
1433 | |||
1434 | long | ||
1435 | sys32_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 | |||
1453 | asmlinkage long | ||
1454 | sysn32_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 | } | ||