cvs commit: src/sys/i386/include atomic.h

Dag-Erling Smørgrav des at des.no
Tue Mar 28 20:58:53 UTC 2006


John Baldwin <jhb at freebsd.org> writes:
> On Tuesday 28 March 2006 14:28, Dag-Erling Smørgrav wrote:
> > which uses uintptr_t, not actual pointers, to avoid warnings.  In
> > effect, that code is broken.
> No, it's on _purpose_, because we do arithmetic on the value (setting
> flags, etc.)  We happen to use curthread as our cookie value, but
> the cookie is an integer, not a pointer.

OK.  PEBKAC on this end, then.

> > Apply the attached patch, see how far a buildkernel gets...
> Your patch could break the kernel, as it doesn't say that the value
> being modified is volatile (volatile void ** != volatile uintptr_t *).
> I can't even get cdecl to tell me how to declare a pointer to a volatile
> void pointer.

uh, it's supposed to be void * volatile * of course.

> > The latter only works because libthr is built with warnings disabled.
> > I just finished working on making it build at WARNS level 2; higher
> > levels will require a major overhaul, because the kernel interface it
> > uses is fundamentally broken.
> No, it needs to use the correct casts.  We've been through this, the
> atomic(9) manpage covers it, etc.

libthr is broken for reasons mostly unrelated to atomic.h.

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the cvs-all mailing list