]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/sh4: Handle user-space atomics
authorRichard Henderson <rth@twiddle.net>
Tue, 18 Jul 2017 20:02:31 +0000 (10:02 -1000)
committerAurelien Jarno <aurelien@aurel32.net>
Tue, 18 Jul 2017 21:39:16 +0000 (23:39 +0200)
commit4bfa602bc2227f5b5a506a4c0c20657d68eaefd1
tree4c74bbd8d12c615eb75beaf01938dc63ea01f1b3
parent1516184d8ea04f9ebd5d5c2009a2b795fc33b82a
target/sh4: Handle user-space atomics

For uniprocessors, SH4 uses optimistic restartable atomic sequences.
Upon an interrupt, a real kernel would simply notice magic values in
the registers and reset the PC to the start of the sequence.

For QEMU, we cannot do this in quite the same way.  Instead, we notice
the normal start of such a sequence (mov #-x,r15), and start a new TB
that can be executed under cpu_exec_step_atomic.

Reported-by: Bruno Haible <bruno@clisp.org>
LP: https://bugs.launchpad.net/bugs/1701971
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Message-Id: <20170718200255.31647-7-rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target/sh4/cpu.h
target/sh4/helper.h
target/sh4/op_helper.c
target/sh4/translate.c