From: David Daney <ddaney@avtrex.com>
Date: Fri, 18 Apr 2008 10:51:33 -0700
At this point I don't really have an opinion as to how to fix the
problem. One thought that comes to mind is to change the definition of
atomic_flag so that the size of the atomic variable is appropriate for
the target architecture (32 bits in the case of MIPS)
It's trivial to synthesize 1-byte and 2-byte atomics if you only have
word sized ones.
You compute a shift and a mask based upon the offset of the byte
within the word, and then do your LL/SC sequence, shifting and masking
the byte you want to change in and out of the word.