aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2018-01-09 18:01:13 +0100
committerMichael Walle <michael@walle.cc>2018-05-21 13:37:12 +0200
commit81e9cbd0ca1131012b058df6804b1f626a6b730c (patch)
treed05f0defac027a288381b82ac57520784bb944a0 /target
parentdfa93a0b6ef51fd8e0285a9991704b51cf884c33 (diff)
downloadqemu-81e9cbd0ca1131012b058df6804b1f626a6b730c.zip
qemu-81e9cbd0ca1131012b058df6804b1f626a6b730c.tar.gz
qemu-81e9cbd0ca1131012b058df6804b1f626a6b730c.tar.bz2
lm32: take BQL before writing IP/IM register
Writing to these registers may raise an interrupt request. Actually, this prevents the milkymist board from starting. Cc: qemu-stable@nongnu.org Signed-off-by: Michael Walle <michael@walle.cc> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Diffstat (limited to 'target')
-rw-r--r--target/lm32/op_helper.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/target/lm32/op_helper.c b/target/lm32/op_helper.c
index 577f830..234d55e 100644
--- a/target/lm32/op_helper.c
+++ b/target/lm32/op_helper.c
@@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t dc)
void HELPER(wcsr_im)(CPULM32State *env, uint32_t im)
{
+ qemu_mutex_lock_iothread();
lm32_pic_set_im(env->pic_state, im);
+ qemu_mutex_unlock_iothread();
}
void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im)
{
+ qemu_mutex_lock_iothread();
lm32_pic_set_ip(env->pic_state, im);
+ qemu_mutex_unlock_iothread();
}
void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx)