atabasedevice: interrupt support.

This commit is contained in:
Maxim Poliakovski 2023-06-18 23:30:06 +02:00
parent 4886b4d52a
commit a4cac2df81
2 changed files with 10 additions and 0 deletions

View File

@ -143,3 +143,11 @@ void AtaBaseDevice::device_control(const uint8_t new_ctrl) {
}
this->r_dev_ctrl = new_ctrl;
}
void AtaBaseDevice::update_intrq(uint8_t new_intrq_state) {
if (!this->is_selected() || (this->r_dev_ctrl & IEN))
return;
this->intrq_state = new_intrq_state;
this->host_obj->report_intrq(new_intrq_state);
}

View File

@ -53,12 +53,14 @@ public:
virtual void device_reset(bool is_soft_reset);
virtual void device_set_signature();
void device_control(const uint8_t new_ctrl);
void update_intrq(uint8_t new_intrq_state);
protected:
bool is_selected() { return ((this->r_dev_head >> 4) & 1) == this->my_dev_id; };
uint8_t my_dev_id = 0; // my IDE device ID configured by the host
uint8_t device_type = ata_interface::DEVICE_TYPE_UNKNOWN;
uint8_t intrq_state = 0; // INTRQ deasserted
IdeChannel* host_obj = nullptr;