From 4f76a4ead2da3755ad42d5acb0a8cb13b448ff7d Mon Sep 17 00:00:00 2001 From: Maxim Poliakovski Date: Wed, 22 Nov 2023 16:58:25 +0100 Subject: [PATCH] Move signal_data_ready() to atabasedevice. --- devices/common/ata/atabasedevice.cpp | 6 ++++++ devices/common/ata/atabasedevice.h | 1 + devices/common/ata/atapibasedevice.cpp | 6 ------ devices/common/ata/atapibasedevice.h | 1 - 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/devices/common/ata/atabasedevice.cpp b/devices/common/ata/atabasedevice.cpp index efa7727..6b1ed2d 100644 --- a/devices/common/ata/atabasedevice.cpp +++ b/devices/common/ata/atabasedevice.cpp @@ -151,3 +151,9 @@ void AtaBaseDevice::update_intrq(uint8_t new_intrq_state) { this->intrq_state = new_intrq_state; this->host_obj->report_intrq(new_intrq_state); } + +void AtaBaseDevice::signal_data_ready() { + this->r_status |= DRQ; + this->r_status &= ~BSY; + this->update_intrq(1); +} diff --git a/devices/common/ata/atabasedevice.h b/devices/common/ata/atabasedevice.h index aaf9363..320e8ce 100644 --- a/devices/common/ata/atabasedevice.h +++ b/devices/common/ata/atabasedevice.h @@ -56,6 +56,7 @@ public: virtual void device_set_signature(); void device_control(const uint8_t new_ctrl); void update_intrq(uint8_t new_intrq_state); + void signal_data_ready(); bool has_data() { return data_ptr && xfer_cnt; diff --git a/devices/common/ata/atapibasedevice.cpp b/devices/common/ata/atapibasedevice.cpp index e34c73f..a267234 100644 --- a/devices/common/ata/atapibasedevice.cpp +++ b/devices/common/ata/atapibasedevice.cpp @@ -196,12 +196,6 @@ void AtapiBaseDevice::data_out_phase() { this->signal_data_ready(); } -void AtapiBaseDevice::signal_data_ready() { - this->r_status |= DRQ; - this->r_status &= ~BSY; - this->update_intrq(1); -} - void AtapiBaseDevice::present_status() { this->r_int_reason |= ATAPI_Int_Reason::IO; this->r_int_reason |= ATAPI_Int_Reason::CoD; diff --git a/devices/common/ata/atapibasedevice.h b/devices/common/ata/atapibasedevice.h index c54225f..39d0f74 100644 --- a/devices/common/ata/atapibasedevice.h +++ b/devices/common/ata/atapibasedevice.h @@ -48,7 +48,6 @@ public: // methods with default implementation virtual void data_out_phase(); - virtual void signal_data_ready(); virtual void present_status(); protected: