interrupt scheduling debugging
This commit is contained in:
parent
2216589a3f
commit
86a788fd3f
3 changed files with 4 additions and 1 deletions
2
cpu.cpp
2
cpu.cpp
|
@ -392,7 +392,7 @@ bool cpu::execute_any_pending_interrupt()
|
||||||
if (interrupts->second.empty() == false) {
|
if (interrupts->second.empty() == false) {
|
||||||
any_queued_interrupts = true;
|
any_queued_interrupts = true;
|
||||||
|
|
||||||
if (i < start_level)
|
if (i < start_level) // at leas we know now that there's an interrupt scheduled
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (can_trigger == false) {
|
if (can_trigger == false) {
|
||||||
|
|
1
cpu.h
1
cpu.h
|
@ -141,6 +141,7 @@ public:
|
||||||
void queue_interrupt(const uint8_t level, const uint8_t vector);
|
void queue_interrupt(const uint8_t level, const uint8_t vector);
|
||||||
std::map<uint8_t, std::set<uint8_t> > get_queued_interrupts() const { return queued_interrupts; }
|
std::map<uint8_t, std::set<uint8_t> > get_queued_interrupts() const { return queued_interrupts; }
|
||||||
std::optional<int> get_interrupt_delay_left() const { return trap_delay; }
|
std::optional<int> get_interrupt_delay_left() const { return trap_delay; }
|
||||||
|
bool check_if_interrupts_pending() const { return any_queued_interrupts; }
|
||||||
|
|
||||||
void trap(uint16_t vector, const int new_ipl = -1, const bool is_interrupt = false);
|
void trap(uint16_t vector, const int new_ipl = -1, const bool is_interrupt = false);
|
||||||
bool is_it_a_trap() const { return it_is_a_trap; }
|
bool is_it_a_trap() const { return it_is_a_trap; }
|
||||||
|
|
|
@ -726,6 +726,8 @@ void show_queued_interrupts(console *const cnsl, cpu *const c)
|
||||||
else
|
else
|
||||||
cnsl->put_string_lf("No delay");
|
cnsl->put_string_lf("No delay");
|
||||||
|
|
||||||
|
cnsl->put_string_lf(format("Interrupt pending flag: %d", c->check_if_interrupts_pending()));
|
||||||
|
|
||||||
auto queued_interrupts = c->get_queued_interrupts();
|
auto queued_interrupts = c->get_queued_interrupts();
|
||||||
|
|
||||||
for(auto & level: queued_interrupts) {
|
for(auto & level: queued_interrupts) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue