Wire CONTROL interrupt.

This commit is contained in:
Maxim Poliakovski 2024-02-12 00:59:24 +01:00
parent 98d661eda1
commit cb8c2cb450
2 changed files with 2 additions and 1 deletions

View File

@ -277,6 +277,7 @@ uint32_t GrandCentral::register_dev_int(IntSrc src_id) {
case IntSrc::SCSI_MESH: return 1 << 13;
case IntSrc::VIA_CUDA: return 1 << 18;
case IntSrc::SWIM3: return 1 << 19;
case IntSrc::CONTROL: return 1 << 26;
case IntSrc::PLATINUM: return 1 << 30;
default:
ABORT_F("%s: unknown interrupt source %d", this->name.c_str(), src_id);

View File

@ -145,7 +145,7 @@ void ControlVideo::notify_bar_change(int bar_num) {
int ControlVideo::device_postinit() {
this->int_ctrl = dynamic_cast<InterruptCtrl*>(
gMachineObj->get_comp_by_type(HWCompType::INT_CTRL));
this->irq_id = 1UL << 26; // FIXME: hardcoded IRQ ID
this->irq_id = this->int_ctrl->register_dev_int(IntSrc::CONTROL);
this->vbl_cb = [this](uint8_t irq_line_state) {
if (irq_line_state != !!(this->int_status & VBL_IRQ_STAT)) {