Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Mar 2006 15:38:18 -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:  <200603281538.21743.jhb@freebsd.org>
In-Reply-To: <200603281528.41502.jhb@freebsd.org>
References:  <Pine.GSO.4.43.0603281500400.18701-100000@sea.ntplx.net> <200603281528.41502.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 28 March 2006 15:28, John Baldwin wrote:
> 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 suc=
h 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.
>=20
> 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.
>=20
> cdecl doesn't seem up to the task.  And again, we already had this
> discussion N months ago.

Actually, my cdecl skills are in decline. :(

declare foo as pointer to volatile pointer to void
void * volatile *foo

The different placement of volatile broken sparc64 though.  However,
an MI wrapper would work around that issue.  I can pursue a patch
that adds the wrapper unless one of you two wants to do it.  I really
wish you'd have spoken up earlier though.  This was changed back in
July.

=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?200603281538.21743.jhb>