Hi guys, Symptoms are: sem_timedwait behaves quite like sem_wait after 0x80000000 usec system has been started. Regards Marc
diff --git a/src/l4/pkg/uclibc/lib/libpthread/src/restart.h b/src/l4/pkg/uclibc/lib/libpthread/src/restart index 26ae5ea..92b71d3 100644 --- a/src/l4/pkg/uclibc/lib/libpthread/src/restart.h +++ b/src/l4/pkg/uclibc/lib/libpthread/src/restart.h @@ -37,7 +37,7 @@ static __inline__ int timedsuspend(pthread_descr self, { #if 1 extern uint64_t __attribute__((weak)) __libc_l4_kclock_offset; - uint64_t clock = abstime->tv_sec * 1000000 + abstime->tv_nsec / 1000; + uint64_t clock = ((uint64_t) abstime->tv_sec) * 1000000 + ((uint64_t) abstime->tv_nsec) / 1000; if (&__libc_l4_kclock_offset) clock -= __libc_l4_kclock_offset; l4_msgtag_t res = l4_usem_down_to(self->p_thsem_cap, &self->p_thsem,
Hi Marc,
On Thu Aug 18, 2011 at 11:48:05 +0200, Marc CHALAND wrote:
Symptoms are: sem_timedwait behaves quite like sem_wait after 0x80000000 usec system has been started.
Merci!
Adam
Hi,
After some testing, I saw my patch is not complete. Here is the complete version which works :).
Regards Marc
diff --git a/src/l4/pkg/uclibc/lib/libpthread/src/restart.h b/src/l4/pkg/uclibc/lib/libpthread/src/restart index 26ae5ea..e4bc11b 100644 --- a/src/l4/pkg/uclibc/lib/libpthread/src/restart.h +++ b/src/l4/pkg/uclibc/lib/libpthread/src/restart.h @@ -37,7 +37,7 @@ static __inline__ int timedsuspend(pthread_descr self, { #if 1 extern uint64_t __attribute__((weak)) __libc_l4_kclock_offset; - uint64_t clock = abstime->tv_sec * 1000000 + abstime->tv_nsec / 1000; + uint64_t clock = ((uint64_t) abstime->tv_sec) * 1000000 + ((uint64_t) abstime->tv_nsec) / 1000; if (&__libc_l4_kclock_offset) clock -= __libc_l4_kclock_offset; l4_msgtag_t res = l4_usem_down_to(self->p_thsem_cap, &self->p_thsem, @@ -69,7 +69,7 @@ static __inline__ int timedsuspend(pthread_descr self, { #if 1 extern uint64_t __attribute__((weak)) __libc_l4_kclock_offset; - uint64_t clock = abstime->tv_sec * 1000000 + abstime->tv_nsec / 1000; + uint64_t clock = ((uint64_t) abstime->tv_sec) * 1000000 + ((uint64_t) abstime->tv_nsec) / 1000; if (&__libc_l4_kclock_offset) clock -= __libc_l4_kclock_offset; l4_timeout_t timeout = L4_IPC_NEVER;
On Mon Aug 22, 2011 at 10:23:35 +0200, Marc CHALAND wrote:
After some testing, I saw my patch is not complete. Here is the complete version which works :).
Ah, true, merci again :)
Adam
l4-hackers@os.inf.tu-dresden.de