On Fri, 19 Jul 2002, Johannes Stezenbach wrote:
> I'm working on a platform without LL/SC, an embedded system/SOC
> with a NEC VR4120A CPU core. To find out the effect of sysmips
> vs. emulated LL/SC vs. the branch-likely trick posted by
> Kevin D. Kissell <email@example.com> on Tue, 22 Jan 2002 18:16:25 +0100
> I created an experimental patch for glibc-2.2.5 which allows
> run-time switching of the _test_and_set() and __compare_and_swap()
> implementation based on the presence of two "switch files" in /etc/.
> I think the beql-hack needs a kernel patch to guarantee k1 !=
> MAGIC_COOKIE after each eret, but for a those few tests I was just
> taking my chance.
Maybe something like this in front of every "eret" instruction?
I am also working with an NEC core, and would much prefer to perform
atomic operations in user space. (I understand that this trick is
probably not SMP safe - I don't really care.)