From 6965e19b184358431dd9832187e541da3af3968f Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 1 Apr 2025 09:44:20 +0200 Subject: kernel/storage, pio, ahci, dma: a lot of patches and fixes according to StorageKit specs and cleaned up DMA driver for a future more robust implementation. Signed-off-by: Amlal El Mahrouss --- dev/kernel/StorageKit/ATA.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'dev/kernel/StorageKit') diff --git a/dev/kernel/StorageKit/ATA.h b/dev/kernel/StorageKit/ATA.h index 1609ec7d..b5e4b2d9 100644 --- a/dev/kernel/StorageKit/ATA.h +++ b/dev/kernel/StorageKit/ATA.h @@ -13,7 +13,7 @@ namespace Kernel { - /// @brief ATA device interface type. + /// @brief ATA device interface class. class ATADeviceInterface : public IDeviceObject { public: @@ -33,7 +33,29 @@ namespace Kernel const Char* Name() const override; + const UInt16& GetIO(); + Void SetIO(const UInt16& io); + + const UInt16& GetMaster(); + Void SetMaster(const UInt16& master); + + const UInt32& GetIndex(); + Void SetIndex(const UInt32& drv); + private: void (*fCleanup)(void) = {nullptr}; + UInt32 fDriveIndex{0U}; + UInt16 fIO, fMaster{0U}; + }; + + /// @brief Initialize an PIO device (StorageKit function) + /// @param is_master is the current PIO master? + /// @return [io:master] for PIO device. + BOOL sk_init_pio_device(BOOL is_master, UInt16& io, UInt8& master); + + /// @brief Acquires a new PIO device with drv_index in mind. + /// @param drv_index The drive index to assign. + /// @return A wrapped device interface if successful, or error code. + ErrorOr sk_acquire_pio_device(Int32 drv_index); } // namespace Kernel -- cgit v1.2.3