cvs commit: src/sys/alpha/include atomic.h src/sys/amd64/include atomic.h src/sys/arm/include atomic.h src/sys/dev/hatm if_hatm_intr.c src/sys/dev/hwpmc hwpmc_mod.c src/sys/i386/include atomic.h src/sys/ia64/include atomic.h src/sys/kern kern_mutex.c ...

John Baldwin jhb at FreeBSD.org
Wed Jul 20 14:59:34 GMT 2005


On Tuesday 19 July 2005 10:30 pm, Jeff Roberson wrote:
> On Fri, 15 Jul 2005, John Baldwin wrote:
> > jhb         2005-07-15 18:17:59 UTC
> >
> >  FreeBSD src repository
> >
> >  Modified files:
> >    sys/alpha/include    atomic.h
> >    sys/amd64/include    atomic.h
> >    sys/arm/include      atomic.h
> >    sys/dev/hatm         if_hatm_intr.c
> >    sys/dev/hwpmc        hwpmc_mod.c
> >    sys/i386/include     atomic.h
> >    sys/ia64/include     atomic.h
> >    sys/kern             kern_mutex.c
> >    sys/powerpc/include  atomic.h
> >    sys/sparc64/include  atomic.h
> >    sys/sys              mutex.h
> >  Log:
> >  Convert the atomic_ptr() operations over to operating on uintptr_t
> >  variables rather than void * variables.  This makes it easier and
> > simpler to get asm constraints and volatile keywords correct.
>
> This breaks ULE as I use atomic cmpsets while passing in actual pointers.
> Do I have to cast everywhere now?  This kind of breaks the notion of it
> operating on a pointer.  Could we at least have an inline or define that
> does the type conversion?

You have to use casts.  I fixed the other places, but missed ULE cause it 
wasn't in GENERIC or LINT. :(  The reason I went with uintptr_t is that 
volatile void ** != volatile uintptr_t *, and some archs (e.g. sparc64) tend 
to assume they can do 'volatile type *' when defining atomic operations in 
various macros.  It is also less confusing for gcc in asm constraints.  Do 
you recall the bug a while back on sparc64 with mbuf reference counts being 
wrong because the compiler didn't think that the memory being modified was 
changed by atomic operations?  This is all part of fixing that.

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the cvs-src mailing list