On 23/06/2024 16:11, BALATON Zoltan wrote:

On Sun, 23 Jun 2024, Mark Cave-Ayland wrote:
For m68k CPUs that do not support unaligned accesses, any such access should
cause the CPU to raise an Address Error exception.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayl...@ilande.co.uk>
---
target/m68k/cpu.c       |  1 +
target/m68k/cpu.h       |  4 ++++
target/m68k/op_helper.c | 11 +++++++++++
3 files changed, 16 insertions(+)

diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c
index efd6bbded8..25e95f9f68 100644
--- a/target/m68k/cpu.c
+++ b/target/m68k/cpu.c
@@ -538,6 +538,7 @@ static const TCGCPUOps m68k_tcg_ops = {
    .cpu_exec_interrupt = m68k_cpu_exec_interrupt,
    .do_interrupt = m68k_cpu_do_interrupt,
    .do_transaction_failed = m68k_cpu_transaction_failed,
+    .do_unaligned_access = m68k_cpu_do_unaligned_access,
#endif /* !CONFIG_USER_ONLY */

Why is it sysemu only? Shouldn't user mode cpu only emulation do the same? I also don't get how this is restricted to pre 68020 CPUs or account for differences between data and inst fetch on 20+ but I may be missing somerhing as I don't know this code or 68k behaviour well. So this is just a question, I'm not saying it's wrong but I don't understand why it's right.

I'm not exactly sure, but I'm guessing that this is handled by the host user code since all CPUs that implement do_unaligned_access do so in a block contained within #ifndef CONFIG_USER_ONLY ... #endif.


ATB,

Mark.


Reply via email to