Date: Thu, 28 Jul 2005 22:53:31 -0400 (EDT) From: Daniel Eischen <deischen@freebsd.org> To: Craig Rodrigues <rodrigc@crodrigues.org> Cc: freebsd-current@freebsd.org, Giorgos Keramidas <keramida@freebsd.org>, davidxu@freebsd.org Subject: Re: libthr & atomic_xxx ops Message-ID: <Pine.GSO.4.43.0507282249300.10291-100000@sea.ntplx.net> In-Reply-To: <20050729023608.GA14084@crodrigues.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 28 Jul 2005, Craig Rodrigues wrote: > On Fri, Jul 29, 2005 at 12:38:39AM +0300, Giorgos Keramidas wrote: > > Recently, libpthread and libthr grew the following warnings in > > CURRENT: > > > > # 2005-07-28 04:37:43.704726 - /usr/src/lib/libpthread/sys/lock.c:183: warning: passing arg 1 of `atomic_store_rel_int' from incompatible pointer type > > This is similar to what I posted for sched_ule.c due to > changes to the macros in <machine/atomic.h>: > http://lists.freebsd.org/pipermail/freebsd-current/2005-July/052894.html > > > Can you try this patch, and see if the warnings go away? I'm testing a patch for libpthread. > --- lib/libpthread/sys/lock.c.orig Thu Jul 28 21:18:48 2005 > +++ lib/libpthread/sys/lock.c Thu Jul 28 21:24:47 2005 > @@ -180,7 +180,7 @@ > atomic_swap_ptr(&lck->l_head, lu->lu_myreq, &lu->lu_watchreq); > > if (lu->lu_watchreq->lr_locked != 0) { > - atomic_store_rel_ptr(&lu->lu_watchreq->lr_watcher, lu); > + atomic_store_rel_ptr((volatile uintptr_t *)&lu->lu_watchreq->lr_watcher, (uintptr_t)lu); The prototype for atomic_store_rel_ptr() is: atomic_store_rel_ptr(volatile void *p, void *v); The changes should be: atomic_store_rel_ptr((volatile void *)&lu->lu_watchreq->lr_watcher, (void *)lu); -- DE
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.43.0507282249300.10291-100000>