diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-01 09:44:20 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-01 09:44:20 +0200 |
| commit | 6965e19b184358431dd9832187e541da3af3968f (patch) | |
| tree | 6c7e782ad9d66c6d1c5d55cc1031e5ef54488d9f /dev/kernel/StorageKit/ATA.h | |
| parent | 2a7a9825fd275d6d999b94614fe87c1d705c7f8f (diff) | |
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 <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/StorageKit/ATA.h')
| -rw-r--r-- | dev/kernel/StorageKit/ATA.h | 24 |
1 files changed, 23 insertions, 1 deletions
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<MountpointInterface*> { 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<ATADeviceInterface> sk_acquire_pio_device(Int32 drv_index); } // namespace Kernel |
