diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-24 03:02:43 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-24 03:02:43 +0100 |
| commit | 83d870e58457a1d335a1d9b9966a6a1887cc297b (patch) | |
| tree | 72888f88c7728c82f3f6df1f4f70591de15eab36 /dev/kernel/src/Storage/ATADeviceInterface.cc | |
| parent | ab37adbacf0f33845804c788b39680cd754752a8 (diff) | |
feat! breaking changes on kernel sources.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/src/Storage/ATADeviceInterface.cc')
| -rw-r--r-- | dev/kernel/src/Storage/ATADeviceInterface.cc | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/dev/kernel/src/Storage/ATADeviceInterface.cc b/dev/kernel/src/Storage/ATADeviceInterface.cc deleted file mode 100644 index 8e15fdea..00000000 --- a/dev/kernel/src/Storage/ATADeviceInterface.cc +++ /dev/null @@ -1,96 +0,0 @@ -/* ======================================== - - Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license. - -======================================== */ - -#include <StorageKit/ATA.h> - -using namespace Kernel; - -/// @brief Class constructor -/// @param Out Drive output -/// @param In Drive input -/// @param Cleanup Drive cleanup. -ATADeviceInterface::ATADeviceInterface(void (*Out)(DeviceInterface*, IMountpoint* outpacket), - void (*In)(DeviceInterface*, IMountpoint* inpacket)) - : DeviceInterface(Out, In) {} - -/// @brief Class desctructor -ATADeviceInterface::~ATADeviceInterface() = default; - -/// @brief Returns the name of the device interface. -/// @return it's name as a string. -const Char* ATADeviceInterface::Name() const { - return "/devices/hda{}"; -} - -/// @brief Output operator. -/// @param Data the disk mountpoint. -/// @return the class itself after operation. -ATADeviceInterface& ATADeviceInterface::operator<<(IMountpoint* Data) { - if (!Data) return *this; - - for (SizeT driveCount = 0; driveCount < kDriveMaxCount; ++driveCount) { - auto interface = Data->GetAddressOf(driveCount); - - if ((interface) && - rt_string_cmp((interface)->fProtocol(), "ATA-", rt_string_len("ATA-")) == 0) { - continue; - } else if ((interface) && - rt_string_cmp((interface)->fProtocol(), "ATA-", rt_string_len("ATA-")) != 0) { - return *this; - } - } - - return (ATADeviceInterface&) DeviceInterface<IMountpoint*>::operator<<(Data); -} - -/// @brief Input operator. -/// @param Data the disk mountpoint. -/// @return the class itself after operation. -ATADeviceInterface& ATADeviceInterface::operator>>(IMountpoint* Data) { - if (!Data) return *this; - - for (SizeT driveCount = 0; driveCount < kDriveMaxCount; ++driveCount) { - auto interface = Data->GetAddressOf(driveCount); - - // really check if it's ATA. - if ((interface) && - rt_string_cmp((interface)->fProtocol(), "ATA-", rt_string_len("ATA-")) == 0) { - continue; - } else if ((interface) && - rt_string_cmp((interface)->fProtocol(), "ATA-", rt_string_len("ATA-")) != 0) { - return *this; - } - } - - return (ATADeviceInterface&) DeviceInterface<IMountpoint*>::operator>>(Data); -} - -const UInt32& ATADeviceInterface::GetIndex() { - return this->fDriveIndex; -} - -Void ATADeviceInterface::SetIndex(const UInt32& drv) { - MUST_PASS(IMountpoint::kDriveIndexInvalid < drv); - this->fDriveIndex = drv; -} - -const UInt16& ATADeviceInterface::GetIO() { - return this->fIO; -} - -Void ATADeviceInterface::SetIO(const UInt16& drv) { - MUST_PASS(0xFFFF != drv); - this->fIO = drv; -} - -const UInt16& ATADeviceInterface::GetMaster() { - return this->fIO; -} - -Void ATADeviceInterface::SetMaster(const UInt16& drv) { - MUST_PASS(0xFFFF != drv); - this->fMaster = drv; -}
\ No newline at end of file |
