1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-25 16:31:42 +00:00

Fix data aborts.

This commit is contained in:
Thomas Harte 2024-04-22 22:08:09 -04:00
parent c485097eed
commit 265d151879

View File

@ -551,7 +551,7 @@ class ConcreteMachine:
uint32_t instruction; uint32_t instruction;
const bool did_read = executor_.bus.read(pc, instruction, executor_.registers().mode(), false); const bool did_read = executor_.bus.read(pc, instruction, executor_.registers().mode(), false);
return pipeline_.exchange( return pipeline_.exchange(
instruction, did_read ? instruction : Pipeline::SWI,
did_read ? Pipeline::SWISubversion::None : Pipeline::SWISubversion::DataAbort); did_read ? Pipeline::SWISubversion::None : Pipeline::SWISubversion::DataAbort);
} }
@ -563,6 +563,8 @@ class ConcreteMachine:
FIQ, FIQ,
}; };
static constexpr uint32_t SWI = 0xef'000000;
uint32_t exchange(uint32_t next, SWISubversion subversion) { uint32_t exchange(uint32_t next, SWISubversion subversion) {
const uint32_t result = upcoming_[active_].opcode; const uint32_t result = upcoming_[active_].opcode;
latched_subversion_ = upcoming_[active_].subversion; 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 // In practice I got into a bit of a race condition between interrupt scheduling and
// flags changes, so have backed off for now. // flags changes, so have backed off for now.
void reschedule(SWISubversion subversion) { void reschedule(SWISubversion subversion) {
upcoming_[active_].opcode = 0xef'000000; upcoming_[active_].opcode = SWI;
upcoming_[active_].subversion = subversion; upcoming_[active_].subversion = subversion;
} }