Update

Converted all the lfds atomic abstraction macros to my current standard, where you always pass in the thing itself, never a pointer.

Corrected the ERG determination code – need to check it closely now though.

That leaves me with one problem before I can use the build system in anger and get it to build every variant on every GCC on every platform; and that’s setting the ERG size in the header file before building…

…which is a bit problematic seeing as you need to build to run the ERG determination code =-)

Back in the day, I did a lot of work to arrange run-time rather than compile-time support for different atomic isolation lengths. You need to use though the larger of ERG and cache line size and I recall backing all that work out because you couldn’t handle that problem in the preprocessor – something to do with needing to find the greatest common divisor, I have no idea now…

I think you can actually issue an instruction to get the ERG length, though. You don’t need to empirically determine it, as I currently do.

It would be very good to deal with this at run time, because people writing for ARM are probably writing for phones and they can’t know what core their code will be running on.