[Xenomai-git] Philippe Gerum : cobalt/posix/compat: fix sys32 helpers
Module: xenomai-3 Branch: next Commit: d2e53792f75e9f5670bf557eb7fde408296c0bf6 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=d2e53792f75e9f5670bf557eb7fde408296c0bf6 Author: Philippe Gerum Date: Wed Oct 29 08:26:53 2014 +0100 cobalt/posix/compat: fix sys32 helpers --- kernel/cobalt/posix/sem.c |2 +- kernel/cobalt/posix/syscall32.c |9 + 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/kernel/cobalt/posix/sem.c b/kernel/cobalt/posix/sem.c index fb9f391..eca42e3 100644 --- a/kernel/cobalt/posix/sem.c +++ b/kernel/cobalt/posix/sem.c @@ -306,7 +306,7 @@ int __cobalt_sem_timedwait(struct cobalt_sem_shadow __user *u_sem, if (pull_ts) { atomic_inc(&sem->state->value); xnlock_put_irqrestore(&nklock, s); - ret = sem_fetch_timeout(&ts, u_ts); + ret = fetch_timeout(&ts, u_ts); xnlock_get_irqsave(&nklock, s); if (ret) break; diff --git a/kernel/cobalt/posix/syscall32.c b/kernel/cobalt/posix/syscall32.c index 87ea0b7..6620fdf 100644 --- a/kernel/cobalt/posix/syscall32.c +++ b/kernel/cobalt/posix/syscall32.c @@ -115,13 +115,6 @@ COBALT_SYSCALL32emu(sem_timedwait, primary, int, (struct cobalt_sem_shadow __user *u_sem, struct compat_timespec __user *u_ts)) { - struct timespec ts; - int ret; - - ret = sys32_get_timespec(&ts, u_ts); - if (ret) - return ret; - return __cobalt_sem_timedwait(u_sem, u_ts, sys32_fetch_timeout); } @@ -136,7 +129,7 @@ COBALT_SYSCALL32emu(clock_getres, current, if (ret) return ret; - return sys32_put_timespec(u_ts, &ts); + return u_ts ? sys32_put_timespec(u_ts, &ts) : 0; } COBALT_SYSCALL32emu(clock_gettime, current, ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/posix/compat: fix sys32 helpers
Module: xenomai-3 Branch: master Commit: d2e53792f75e9f5670bf557eb7fde408296c0bf6 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=d2e53792f75e9f5670bf557eb7fde408296c0bf6 Author: Philippe Gerum Date: Wed Oct 29 08:26:53 2014 +0100 cobalt/posix/compat: fix sys32 helpers --- kernel/cobalt/posix/sem.c |2 +- kernel/cobalt/posix/syscall32.c |9 + 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/kernel/cobalt/posix/sem.c b/kernel/cobalt/posix/sem.c index fb9f391..eca42e3 100644 --- a/kernel/cobalt/posix/sem.c +++ b/kernel/cobalt/posix/sem.c @@ -306,7 +306,7 @@ int __cobalt_sem_timedwait(struct cobalt_sem_shadow __user *u_sem, if (pull_ts) { atomic_inc(&sem->state->value); xnlock_put_irqrestore(&nklock, s); - ret = sem_fetch_timeout(&ts, u_ts); + ret = fetch_timeout(&ts, u_ts); xnlock_get_irqsave(&nklock, s); if (ret) break; diff --git a/kernel/cobalt/posix/syscall32.c b/kernel/cobalt/posix/syscall32.c index 87ea0b7..6620fdf 100644 --- a/kernel/cobalt/posix/syscall32.c +++ b/kernel/cobalt/posix/syscall32.c @@ -115,13 +115,6 @@ COBALT_SYSCALL32emu(sem_timedwait, primary, int, (struct cobalt_sem_shadow __user *u_sem, struct compat_timespec __user *u_ts)) { - struct timespec ts; - int ret; - - ret = sys32_get_timespec(&ts, u_ts); - if (ret) - return ret; - return __cobalt_sem_timedwait(u_sem, u_ts, sys32_fetch_timeout); } @@ -136,7 +129,7 @@ COBALT_SYSCALL32emu(clock_getres, current, if (ret) return ret; - return sys32_put_timespec(u_ts, &ts); + return u_ts ? sys32_put_timespec(u_ts, &ts) : 0; } COBALT_SYSCALL32emu(clock_gettime, current, ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git