Kernel: Untangle StorageController from PCI::DeviceController

This commit is contained in:
Jean-Baptiste Boric 2021-01-18 21:40:47 +01:00 committed by Andreas Kling
parent 68c8b52612
commit 2f8b047339
3 changed files with 8 additions and 9 deletions

View file

@ -68,7 +68,8 @@ void IDEController::complete_current_request(AsyncDeviceRequest::RequestResult)
}
IDEController::IDEController(PCI::Address address, bool force_pio)
: StorageController(address)
: StorageController()
, PCI::DeviceController(address)
{
initialize(force_pio);
}

View file

@ -37,7 +37,8 @@ namespace Kernel {
class AsyncBlockDeviceRequest;
class IDEController final : public StorageController {
class IDEController final : public StorageController
, public PCI::DeviceController {
AK_MAKE_ETERNAL
public:
public:

View file

@ -42,24 +42,21 @@ namespace Kernel {
class AsyncBlockDeviceRequest;
class StorageDevice;
class StorageController : public RefCounted<StorageController>
, public PCI::DeviceController {
class StorageController : public RefCounted<StorageController> {
AK_MAKE_ETERNAL
public:
enum class Type : u8 {
IDE,
NVMe
};
virtual ~StorageController() = default;
virtual Type type() const = 0;
virtual RefPtr<StorageDevice> device(u32 index) const = 0;
virtual size_t devices_count() const = 0;
protected:
explicit StorageController(PCI::Address address)
: PCI::DeviceController(address)
{
}
virtual void start_request(const StorageDevice&, AsyncBlockDeviceRequest&) = 0;
protected: