Kernelspace C11 atomics for MIPS

John Baldwin jhb at freebsd.org
Tue Jun 4 16:03:59 UTC 2013


On Tuesday, June 04, 2013 4:19:20 am Andre Oppermann wrote:
> On 03.06.2013 16:04, Ed Schouten wrote:
> > Hi,
> >
> > As of r251230, it should be possible to use C11 atomics in
> > kernelspace, by including <sys/stdatomic.h>! Even when not using Clang
> > (but GCC 4.2), it is possible to use quite a large portion of the API.
> 
> I'm a bit wary of *kernel* developers using C11-native atomics as opposed
> to our own atomic API.  This could lead to a proliferation of home-grown,
> more or less correctly working, locks and variants thereof (mostly less
> correct).

I think this is not a big deal to worry about as developers have already been 
free to do this via <machine/atomic.h> and haven't gone super crazy.  
Replacing <machine/atomic.h> with <sys/stdatomic.h> is probably fine and 
should be a simple drop-in replacement for our lock implementations.

-- 
John Baldwin


More information about the freebsd-mips mailing list