qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 07/15] target/m68k: Fix pc, c flag, and address argument f


From: Laurent Vivier
Subject: Re: [PATCH v2 07/15] target/m68k: Fix pc, c flag, and address argument for EXCP_DIV0
Date: Sat, 4 Dec 2021 17:50:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0

Le 02/12/2021 à 21:48, Richard Henderson a écrit :
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().

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
  target/m68k/helper.h       | 12 +++++-----
  linux-user/m68k/cpu_loop.c |  2 +-
  target/m68k/op_helper.c    | 48 +++++++++++++++++++++++---------------
  target/m68k/translate.c    | 33 +++++++++++++-------------
  4 files changed, 52 insertions(+), 43 deletions(-)


Reviewed-by: Laurent Vivier <laurent@vivier.eu>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]