Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions devices/ioctrl/maciobase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ void MacIoBase::ack_int_common(uint64_t irq_id, uint8_t irq_line_state) {
if ((this->int_mask & MACIO_INT_MODE) ||
(irq_line_state && !(this->int_levels & irq_id))) {
this->int_events |= irq_id;
} else {
this->int_events &= ~irq_id;
}
// Events remain latched until software writes InterruptClear.

// update IRQ line state
if (irq_line_state) {
this->int_levels |= irq_id;
Expand Down
6 changes: 5 additions & 1 deletion devices/ioctrl/maciotwo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,10 @@ void MacIoTwo::mio_ctrl_write(uint32_t offset, uint32_t value, int size) {

switch (offset & ~3) {
case MIO_INT_MASK2:
this->int_mask |= uint64_t(value & ~MACIO_INT_MODE) << 32;
// Preserve the first bank and the read-only IntMode bit.
this->int_mask = (this->int_mask & 0x80000000FFFFFFFFULL) |
(uint64_t(value & ~MACIO_INT_MODE) << 32);
this->clear_cpu_int();
this->signal_cpu_int();
break;
case MIO_INT_CLEAR2:
Expand All @@ -377,6 +380,7 @@ void MacIoTwo::mio_ctrl_write(uint32_t offset, uint32_t value, int size) {
this->int_mask = (this->int_mask & 0x7FFFFFFF00000000ULL) | value;
// copy IntMode bit to InterruptMask2 register
this->int_mask |= uint64_t(this->int_mask & MACIO_INT_MODE) << 32;
this->clear_cpu_int();
this->signal_cpu_int();
break;
case MIO_INT_CLEAR1:
Expand Down
Loading