BQL patches for the lm32 target
cover BQL patches for the lm32 target
I'll send a pull request next week if there are no comments on the patches.
Michael Walle (2):
lm32: take BQL before writing IP/IM register
target/lm32: hold BQL in gdbstub
target/lm32/gdbstub.c | 4 ++++ target/lm32/op_helper.c | 4 ++++ 2 files changed, 8 insertions(+)
Signature · 1 line
2.11.0
PATCH 1/2 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.
Signed-off-by Michael Walle <[email protected]>
Reviewed-by Alex Bennée <[email protected]>
--- target/lm32/op_helper.c | 4 ++++ 1 file changed, 4 insertions(+)
target/lm32/op_helper.c +4 -0
@@ -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)
Signature · 1 line
2.11.0
PATCH 2/2 target/lm32: hold BQL in gdbstub
In reply to Michael WalleChanging the IP/IM registers may cause interrupts, so hold the BQL.
Signed-off-by Michael Walle <[email protected]>
--- target/lm32/gdbstub.c | 4 ++++ 1 file changed, 4 insertions(+)
target/lm32/gdbstub.c +4 -0
@@ -82,10 +82,14 @@ int lm32_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) env->ie = tmp;break ;case 37 : +qemu_mutex_lock_iothread ();lm32_pic_set_im (env->pic_state, tmp); +qemu_mutex_unlock_iothread ();break ;case 38 : +qemu_mutex_lock_iothread ();lm32_pic_set_ip (env->pic_state, tmp); +qemu_mutex_unlock_iothread ();break ; } }
Signature · 1 line
2.11.0