From 265d1518799361723ce72d0baba01a61d09824db Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 22 Apr 2024 22:08:09 -0400 Subject: [PATCH] Fix data aborts. --- Machines/Acorn/Archimedes/Archimedes.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Machines/Acorn/Archimedes/Archimedes.cpp b/Machines/Acorn/Archimedes/Archimedes.cpp index f9fe9b5bf..85dd4ddc4 100644 --- a/Machines/Acorn/Archimedes/Archimedes.cpp +++ b/Machines/Acorn/Archimedes/Archimedes.cpp @@ -551,7 +551,7 @@ class ConcreteMachine: uint32_t instruction; const bool did_read = executor_.bus.read(pc, instruction, executor_.registers().mode(), false); return pipeline_.exchange( - instruction, + did_read ? instruction : Pipeline::SWI, did_read ? Pipeline::SWISubversion::None : Pipeline::SWISubversion::DataAbort); } @@ -563,6 +563,8 @@ class ConcreteMachine: FIQ, }; + static constexpr uint32_t SWI = 0xef'000000; + uint32_t exchange(uint32_t next, SWISubversion subversion) { const uint32_t result = upcoming_[active_].opcode; latched_subversion_ = upcoming_[active_].subversion; @@ -586,7 +588,7 @@ class ConcreteMachine: // In practice I got into a bit of a race condition between interrupt scheduling and // flags changes, so have backed off for now. void reschedule(SWISubversion subversion) { - upcoming_[active_].opcode = 0xef'000000; + upcoming_[active_].opcode = SWI; upcoming_[active_].subversion = subversion; }