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/AHCIDeviceInterface.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/AHCIDeviceInterface.cc')
| -rw-r--r-- | dev/kernel/src/Storage/AHCIDeviceInterface.cc | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/dev/kernel/src/Storage/AHCIDeviceInterface.cc b/dev/kernel/src/Storage/AHCIDeviceInterface.cc deleted file mode 100644 index 02b39fb5..00000000 --- a/dev/kernel/src/Storage/AHCIDeviceInterface.cc +++ /dev/null @@ -1,87 +0,0 @@ -/* ======================================== - - Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license. - -======================================== */ - -#include <StorageKit/AHCI.h> - -using namespace Kernel; - -/// @brief Class constructor -/// @param Out Drive output -/// @param In Drive input -/// @param Cleanup Drive cleanup. -AHCIDeviceInterface::AHCIDeviceInterface(void (*out)(DeviceInterface* self, IMountpoint* outpacket), - void (*in)(DeviceInterface* self, IMountpoint* inpacket)) - : DeviceInterface(out, in) {} - -/// @brief Class desctructor -AHCIDeviceInterface::~AHCIDeviceInterface() = default; - -/// @brief Returns the name of the device interface. -/// @return it's name as a string. -const Char* AHCIDeviceInterface::Name() const { - return "/devices/sda{}"; -} - -/// @brief Output operator. -/// @param mnt the disk mountpoint. -/// @return the class itself after operation. -AHCIDeviceInterface& AHCIDeviceInterface::operator<<(IMountpoint* mnt) { - if (!mnt) return *this; - - for (SizeT driveCount = 0; driveCount < kDriveMaxCount; ++driveCount) { - auto interface = mnt->GetAddressOf(driveCount); - - if ((interface) && - rt_string_cmp((interface)->fProtocol(), "AHCI", rt_string_len("AHCI")) == 0) { - continue; - } else if ((interface) && - rt_string_cmp((interface)->fProtocol(), "AHCI", rt_string_len("AHCI")) != 0) { - return *this; - } - } - - return (AHCIDeviceInterface&) DeviceInterface<IMountpoint*>::operator<<(mnt); -} - -/// @brief Input operator. -/// @param mnt the disk mountpoint. -/// @return the class itself after operation. -AHCIDeviceInterface& AHCIDeviceInterface::operator>>(IMountpoint* mnt) { - if (!mnt) return *this; - - for (SizeT driveCount = 0; driveCount < kDriveMaxCount; ++driveCount) { - auto interface = mnt->GetAddressOf(driveCount); - - // really check if it's ATA. - if ((interface) && - rt_string_cmp((interface)->fProtocol(), "AHCI", rt_string_len("AHCI")) == 0) { - continue; - } else if ((interface) && - rt_string_cmp((interface)->fProtocol(), "AHCI", rt_string_len("AHCI")) != 0) { - return *this; - } - } - - return (AHCIDeviceInterface&) DeviceInterface<IMountpoint*>::operator>>(mnt); -} - -const UInt16& AHCIDeviceInterface::GetPortsImplemented() { - return this->fPortsImplemented; -} - -Void AHCIDeviceInterface::SetPortsImplemented(const UInt16& pi) { - MUST_PASS(pi > 0); - this->fPortsImplemented = pi; -} - -const UInt32& AHCIDeviceInterface::GetIndex() { - return this->fDriveIndex; -} - -Void AHCIDeviceInterface::SetIndex(const UInt32& drv) { - MUST_PASS(IMountpoint::kDriveIndexInvalid < drv); - this->fDriveIndex = drv; -}
\ No newline at end of file |
