summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/StorageKit
diff options
context:
space:
mode:
Diffstat (limited to 'dev/kernel/StorageKit')
-rw-r--r--dev/kernel/StorageKit/AHCI.h49
-rw-r--r--dev/kernel/StorageKit/ATA.h56
-rw-r--r--dev/kernel/StorageKit/NVME.h32
-rw-r--r--dev/kernel/StorageKit/PRDT.h33
-rw-r--r--dev/kernel/StorageKit/SCSI.h11
-rw-r--r--dev/kernel/StorageKit/StorageKit.h21
6 files changed, 0 insertions, 202 deletions
diff --git a/dev/kernel/StorageKit/AHCI.h b/dev/kernel/StorageKit/AHCI.h
deleted file mode 100644
index 82bd9747..00000000
--- a/dev/kernel/StorageKit/AHCI.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* ========================================
-
- Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
-
-======================================== */
-
-#pragma once
-
-#include <KernelKit/DeviceMgr.h>
-#include <KernelKit/DriveMgr.h>
-#include <NeKit/OwnPtr.h>
-
-namespace Kernel {
-/// @brief AHCIDeviceInterface class
-/// @details This class is used to send and receive data from the AHCI device.
-/// @note The class is derived from the DeviceInterface class.
-class AHCIDeviceInterface NE_DEVICE<IMountpoint*> {
- public:
- explicit AHCIDeviceInterface(void (*out)(DeviceInterface* self, IMountpoint* out),
- void (*in)(DeviceInterface* self, IMountpoint* in));
-
- virtual ~AHCIDeviceInterface() override;
-
- public:
- AHCIDeviceInterface& operator=(const AHCIDeviceInterface&) = default;
- AHCIDeviceInterface(const AHCIDeviceInterface&) = default;
-
- const Char* Name() const override;
-
- const UInt16& GetPortsImplemented();
-
- Void SetPortsImplemented(const UInt16& pi);
-
- const UInt32& GetIndex();
-
- Void SetIndex(const UInt32& drv);
-
- public:
- AHCIDeviceInterface& operator<<(IMountpoint* Data) override;
- AHCIDeviceInterface& operator>>(IMountpoint* Data) override;
-
- private:
- UInt16 fPortsImplemented{0U};
- UInt32 fDriveIndex{0U};
-};
-
-UInt16 sk_init_ahci_device(BOOL atapi);
-ErrorOr<AHCIDeviceInterface> sk_acquire_ahci_device(UInt32 drv_index);
-} // namespace Kernel
diff --git a/dev/kernel/StorageKit/ATA.h b/dev/kernel/StorageKit/ATA.h
deleted file mode 100644
index f92e09d3..00000000
--- a/dev/kernel/StorageKit/ATA.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* ========================================
-
- Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
-
-======================================== */
-
-#pragma once
-
-#include <KernelKit/DeviceMgr.h>
-#include <KernelKit/DriveMgr.h>
-#include <NeKit/OwnPtr.h>
-#include <NeKit/Utils.h>
-
-namespace Kernel {
-/// @brief ATA device interface class.
-class ATADeviceInterface : public DeviceInterface<IMountpoint*> {
- public:
- explicit ATADeviceInterface(void (*Out)(DeviceInterface*, IMountpoint* outpacket),
- void (*In)(DeviceInterface*, IMountpoint* inpacket));
-
- virtual ~ATADeviceInterface();
-
- public:
- ATADeviceInterface& operator<<(IMountpoint* Data) override;
- ATADeviceInterface& operator>>(IMountpoint* Data) override;
-
- public:
- ATADeviceInterface& operator=(const ATADeviceInterface&) = default;
- ATADeviceInterface(const ATADeviceInterface&) = default;
-
- 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:
- 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_ata_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_ata_device(Int32 drv_index);
-} // namespace Kernel
diff --git a/dev/kernel/StorageKit/NVME.h b/dev/kernel/StorageKit/NVME.h
deleted file mode 100644
index d1c036ab..00000000
--- a/dev/kernel/StorageKit/NVME.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ========================================
-
- Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
-
-======================================== */
-
-#pragma once
-
-#include <KernelKit/DeviceMgr.h>
-#include <KernelKit/DriveMgr.h>
-
-namespace Kernel {
-class NVMEDeviceInterface final NE_DEVICE<IMountpoint*> {
- public:
- explicit NVMEDeviceInterface(Void (*out)(DeviceInterface*, IMountpoint* out_packet),
- Void (*in)(DeviceInterface*, IMountpoint* in_packet),
- Void (*cleanup)(Void));
-
- ~NVMEDeviceInterface() override;
-
- public:
- NE_COPY_DEFAULT(NVMEDeviceInterface)
-
- const Char* Name() const override;
-
- public:
- OwnPtr<IMountpoint*> operator()(UInt32 dma_low, UInt32 dma_high, SizeT dma_sz);
-
- private:
- Void (*fCleanup)(Void) = {nullptr};
-};
-} // namespace Kernel
diff --git a/dev/kernel/StorageKit/PRDT.h b/dev/kernel/StorageKit/PRDT.h
deleted file mode 100644
index 44eb11be..00000000
--- a/dev/kernel/StorageKit/PRDT.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* ========================================
-
- Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
-
-======================================== */
-
-#pragma once
-
-#include <KernelKit/PCI/DMA.h>
-#include <KernelKit/PCI/Iterator.h>
-#include <NeKit/Ref.h>
-
-#define kPrdtTransferSize (sizeof(Kernel::UShort))
-
-namespace Kernel {
-/// @brief Tranfer information about PRD.
-enum {
- kPRDTTransferInProgress,
- kPRDTTransferIsDone,
- kPRDTTransferCount,
-};
-
-/// @brief Physical Region Descriptor Table.
-struct PRDT final {
- UInt32 fPhysAddress;
- UInt32 fSectorCount;
- UInt8 fEndBit;
-};
-
-void construct_prdt(Ref<PRDT>& prd);
-
-EXTERN_C Int32 kPRDTTransferStatus;
-} // namespace Kernel
diff --git a/dev/kernel/StorageKit/SCSI.h b/dev/kernel/StorageKit/SCSI.h
deleted file mode 100644
index 4dad00ad..00000000
--- a/dev/kernel/StorageKit/SCSI.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* ========================================
-
- Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
-
-======================================== */
-
-#pragma once
-
-#include <modules/SCSI/SCSI.h>
-
-namespace Kernel {} // namespace Kernel \ No newline at end of file
diff --git a/dev/kernel/StorageKit/StorageKit.h b/dev/kernel/StorageKit/StorageKit.h
deleted file mode 100644
index c9633392..00000000
--- a/dev/kernel/StorageKit/StorageKit.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* ========================================
-
- Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
-
-======================================== */
-
-#pragma once
-
-#define kDriveSectorSizeHDD (512U)
-#define kDriveSectorSizeSSD (512U)
-#define kDriveSectorSizeOptical (2048U)
-
-namespace Kernel {
-template <typename T>
-class DeviceInterface;
-
-class NVMEDeviceInterface;
-class AHCIDeviceInterface;
-class ATADeviceInterface;
-class SCSIDeviceInterface;
-} // namespace Kernel