mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
target/m68k: Fix pc, c flag, and address argument for EXCP_DIV0
According to the M68040 Users Manual, section 8.4.3, Six word stack frame (format 2), Zero Div (and others) is supposed to record the next insn in PC and the address of the trapping instruction in ADDRESS. While the N, Z and V flags are documented to be undefine on DIV0, the C flag is documented as always cleared. Update helper_div* to take the instruction length as an argument and use raise_exception_format2. Hoist the reset of the C flag above the division by zero check. Update m68k_interrupt_all to pass mmu.ar to do_stack_frame. Update cpu_loop to pass mmu.ar to siginfo.si_addr, as the kernel does in trap_c(). Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220602013401.303699-8-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
ad5a5cf97d
commit
710d747b2d
4 changed files with 52 additions and 43 deletions
|
@ -1,12 +1,12 @@
|
|||
DEF_HELPER_1(bitrev, i32, i32)
|
||||
DEF_HELPER_1(ff1, i32, i32)
|
||||
DEF_HELPER_FLAGS_2(sats, TCG_CALL_NO_RWG_SE, i32, i32, i32)
|
||||
DEF_HELPER_3(divuw, void, env, int, i32)
|
||||
DEF_HELPER_3(divsw, void, env, int, s32)
|
||||
DEF_HELPER_4(divul, void, env, int, int, i32)
|
||||
DEF_HELPER_4(divsl, void, env, int, int, s32)
|
||||
DEF_HELPER_4(divull, void, env, int, int, i32)
|
||||
DEF_HELPER_4(divsll, void, env, int, int, s32)
|
||||
DEF_HELPER_4(divuw, void, env, int, i32, int)
|
||||
DEF_HELPER_4(divsw, void, env, int, s32, int)
|
||||
DEF_HELPER_5(divul, void, env, int, int, i32, int)
|
||||
DEF_HELPER_5(divsl, void, env, int, int, s32, int)
|
||||
DEF_HELPER_5(divull, void, env, int, int, i32, int)
|
||||
DEF_HELPER_5(divsll, void, env, int, int, s32, int)
|
||||
DEF_HELPER_2(set_sr, void, env, i32)
|
||||
DEF_HELPER_3(cf_movec_to, void, env, i32, i32)
|
||||
DEF_HELPER_3(m68k_movec_to, void, env, i32, i32)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue