From owner-freebsd-current@FreeBSD.ORG Fri Jul 29 03:12:04 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9BF5F16A41F; Fri, 29 Jul 2005 03:12:04 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CAFB43D45; Fri, 29 Jul 2005 03:12:03 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.4/8.13.4/NETPLEX) with ESMTP id j6T3C2Ew025820; Thu, 28 Jul 2005 23:12:02 -0400 (EDT) Date: Thu, 28 Jul 2005 23:12:02 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Craig Rodrigues In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: freebsd-current@freebsd.org, Giorgos Keramidas , davidxu@freebsd.org Subject: Re: libthr & atomic_xxx ops X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2005 03:12:04 -0000 On Thu, 28 Jul 2005, Daniel Eischen wrote: > 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 : > > 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); Hmm, I guess it's no longer the above, but: atomic_store_rel_ptr(volatile void *p, uintptr_t v); This doesn't seem right. uintptr_t is just __uint32_t (on 32-bit archs). It seems more intuitive to use a void * since you want to play with pointers. -- DE