Commit 49a6e9c0 authored by Jakub Jelínek's avatar Jakub Jelínek Committed by David S. Miller

[SPARC64]: sys_timer_create needs 32-bit translation.

parent 9ffa3bf2
......@@ -2779,3 +2779,41 @@ long sys32_lookup_dcookie(u32 cookie_high, u32 cookie_low, char *buf, size_t len
return sys_lookup_dcookie((u64)cookie_high << 32 | cookie_low,
buf, len);
}
extern asmlinkage long
sys_timer_create(clockid_t which_clock, struct sigevent *timer_event_spec,
timer_t * created_timer_id);
long
sys32_timer_create(u32 clock, struct sigevent32 *se32, timer_t *timer_id)
{
struct sigevent se;
mm_segment_t oldfs;
timer_t t;
long err;
if (se32 == NULL)
return sys_timer_create(clock, NULL, timer_id);
memset(&se, 0, sizeof(struct sigevent));
if (get_user(se.sigev_value.sival_int, &se32->sigev_value.sival_int) ||
__get_user(se.sigev_signo, &se32->sigev_signo) ||
__get_user(se.sigev_notify, &se32->sigev_notify) ||
__copy_from_user(&se._sigev_un._pad, &se32->_sigev_un._pad,
sizeof(se._sigev_un._pad)))
return -EFAULT;
if (!access_ok(VERIFY_WRITE,timer_id,sizeof(timer_t)))
return -EFAULT;
oldfs = get_fs();
set_fs(KERNEL_DS);
err = sys_timer_create(clock, &se, &t);
set_fs(oldfs);
if (!err)
err = __put_user (t, timer_id);
return err;
}
......@@ -72,7 +72,7 @@ sys_call_table32:
/*250*/ .word sys32_mremap, sys32_sysctl, sys_getsid, sys_fdatasync, sys32_nfsservctl
.word sys_ni_syscall, compat_clock_settime, compat_clock_gettime, compat_clock_getres, compat_clock_nanosleep
/*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, compat_timer_settime, compat_timer_gettime, sys_timer_getoverrun
.word sys_timer_delete, sys_timer_create, sys_ni_syscall
.word sys_timer_delete, sys32_timer_create, sys_ni_syscall
/* Now the 64-bit native Linux syscall table. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment