overhaul sh atomics for new atomics framework, add j-core cas.l backend
authorRich Felker <dalias@aerifal.cx>
Thu, 21 Jan 2016 19:28:15 +0000 (19:28 +0000)
committerRich Felker <dalias@aerifal.cx>
Thu, 21 Jan 2016 19:43:04 +0000 (19:43 +0000)
commit61b1e75f7d8004461f2e18f171c26c2f545eed32
tree7a88f8d51ee3f049745b147b7f36fc8ee22e0e62
parent1315596b510189b5159e742110b504177bdd4932
overhaul sh atomics for new atomics framework, add j-core cas.l backend

sh needs runtime-selected atomic backends since there are a number of
supported models that use non-forwards-compatible (non-smp-compatible)
atomic mechanisms. previously, the code paths for this were highly
inefficient since they involved C function calls with multiple
branches in the callee and heavy spills in the caller. the new code
performs calls the runtime-selected asm fragment from inline asm with
extremely minimal clobbers, rather than using a function call.

for the sh4a case where the atomic mechanism is known and there is no
forward-compatibility issue, the movli.l and movco.l instructions are
provided as a_ll and a_sc, allowing the new shared atomic.h to
generate efficient inline versions of all the basic atomic operations
without needing a cas loop.
arch/sh/atomic_arch.h
arch/sh/src/__set_thread_area.c [deleted file]
arch/sh/src/atomic.c [deleted file]
arch/sh/src/sh_atomic.h [deleted file]
src/thread/sh/__set_thread_area.c [new file with mode: 0644]
src/thread/sh/__set_thread_area.s [deleted file]
src/thread/sh/atomics.s [new file with mode: 0644]