locking and iterating through queues is expensive so added flag that indicates if there is any interrupt pending
This commit is contained in:
parent
4bdc5272b2
commit
2563bbac57
2 changed files with 8 additions and 3 deletions
10
cpu.cpp
10
cpu.cpp
|
@ -278,7 +278,9 @@ bool cpu::check_queued_interrupts()
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
any_queued_interrupts = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -292,6 +294,8 @@ void cpu::queue_interrupt(const uint8_t level, const uint8_t vector)
|
|||
|
||||
qi_cv.notify_all();
|
||||
|
||||
any_queued_interrupts = true;
|
||||
|
||||
DOLOG(debug, true, "Queueing interrupt vector %o (IPL %d, current: %d), n: %zu", vector, level, getPSW_spl(), it->second.size());
|
||||
}
|
||||
|
||||
|
@ -2159,8 +2163,8 @@ void cpu::step_a()
|
|||
if ((b->getMMR0() & 0160000) == 0)
|
||||
b->clearMMR1();
|
||||
|
||||
if (check_queued_interrupts())
|
||||
return;
|
||||
if (any_queued_interrupts && check_queued_interrupts())
|
||||
return; // documentation
|
||||
}
|
||||
|
||||
void cpu::step_b()
|
||||
|
|
1
cpu.h
1
cpu.h
|
@ -43,6 +43,7 @@ private:
|
|||
std::map<uint8_t, std::set<uint8_t> > queued_interrupts;
|
||||
std::mutex qi_lock;
|
||||
std::condition_variable qi_cv;
|
||||
std::atomic_bool any_queued_interrupts { false };
|
||||
|
||||
std::set<uint16_t> breakpoints;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue