Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Mar 2006 15:28:37 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        Daniel Eischen <deischen@freebsd.org>
Cc:        Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= <des@des.no>, src-committers@freebsd.org, cvs-all@freebsd.org, cvs-src@freebsd.org
Subject:   Re: cvs commit: src/sys/i386/include atomic.h
Message-ID:  <200603281528.41502.jhb@freebsd.org>
In-Reply-To: <Pine.GSO.4.43.0603281500400.18701-100000@sea.ntplx.net>
References:  <Pine.GSO.4.43.0603281500400.18701-100000@sea.ntplx.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 28 March 2006 15:04, Daniel Eischen wrote:
> On Tue, 28 Mar 2006, Dag-Erling [iso-8859-1] Sm=F8rgrav wrote:
>=20
> > John Baldwin <jhb@freebsd.org> writes:
> > > s/off/on/ I trust
> > >
> > > Not true.  The tinderbox would attest to that.  Please see code such =
as
> > > this:  [...]
> >
> > which uses uintptr_t, not actual pointers, to avoid warnings.  In
> > effect, that code is broken.
> >
> > Apply the attached patch, see how far a buildkernel gets...
> >
> > I think the proper thing to do, to cover all your bases, would be to
> > define a MD atomic_*_intptr family which operated on uintptr_t, and
> > define an MI atomic_*_ptr family which operates on void * based on
> > that.
>=20
> I would like to see that.
>=20
> > > Even userland uses casts when it uses void * rather than uintptr_t for
> > > the underlying type.  See src/lib/libpthread/sys/lock.c or
> > > src/lib/libthr/thr_umtx.h.
>=20
> I didn't like having to do that in libpthread.  It was confusing
> to me.  I'd be happy if I never had to deal with uintptr_t.

Then please provide the C idiom for declaring a pointer to a volatile
void pointer.  volatile void ** declares a pointer to a pointer to a
volatile void.  This is a real issue that was causing problems with
refcounting on mbuf's on sparc64 last year due to us not properly
letting the compiler know what values were being invalidated.

cdecl doesn't seem up to the task.  And again, we already had this
discussion N months ago.

=2D-=20
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =3D  http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603281528.41502.jhb>