1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-21 21:33:54 +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;
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;
}