diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-18 21:39:29 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-18 21:39:29 +0200 |
| commit | da70596895d8135e08f8caac6978117697b4c021 (patch) | |
| tree | 2516785b5434df8453687f05dc8dd877438901ab /dev/Kernel/Sources/NewFS+IO.cxx | |
| parent | 005de79004c9d30e64bdee6e14e06f9d47d1f2ab (diff) | |
[REFACTOR]
Improved project structure.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/Sources/NewFS+IO.cxx')
| -rw-r--r-- | dev/Kernel/Sources/NewFS+IO.cxx | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/dev/Kernel/Sources/NewFS+IO.cxx b/dev/Kernel/Sources/NewFS+IO.cxx deleted file mode 100644 index ddcecde4..00000000 --- a/dev/Kernel/Sources/NewFS+IO.cxx +++ /dev/null @@ -1,101 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Technologies. - -------------------------------------------- */ - -#include <KernelKit/DriveManager.hxx> -#include <KernelKit/FileManager.hxx> - -/************************************************************* - * - * File: NewFS+IO.cxx - * Purpose: Filesystem to mountpoint interface. - * Date: 3/26/24 - * - * Copyright ZKA Technologies., all rights reserved. - * - *************************************************************/ - -#ifdef __FSKIT_USE_NEWFS__ - -#include <FirmwareKit/EPM.hxx> - -/// Useful macros. - -#define NEWFS_WRITE(DRV, TRAITS, MP) (MP->DRV()).fOutput(&TRAITS) -#define NEWFS_READ(DRV, TRAITS, MP) (MP->DRV()).fInput(&TRAITS) - -using namespace Kernel; - -/// @brief Read from newfs disk. -/// @param Mnt mounted interface. -/// @param DrvTrait drive info -/// @param DrvIndex drive index. -/// @return -Int32 fs_newfs_read(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex) -{ - if (!Mnt) - return -1; - - DrvTrait.fPacket.fPacketGood = false; - - switch (DrvIndex) - { - case kNewFSSubDriveA: { - NEWFS_READ(A, DrvTrait.fPacket, Mnt); - break; - } - case kNewFSSubDriveB: { - NEWFS_READ(B, DrvTrait.fPacket, Mnt); - break; - } - case kNewFSSubDriveC: { - NEWFS_READ(C, DrvTrait.fPacket, Mnt); - break; - } - case kNewFSSubDriveD: { - NEWFS_READ(D, DrvTrait.fPacket, Mnt); - break; - } - } - - return DrvTrait.fPacket.fPacketGood; -} - -/// @brief Write to newfs disk. -/// @param Mnt mounted interface. -/// @param DrvTrait drive info -/// @param DrvIndex drive index. -/// @return -Int32 fs_newfs_write(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex) -{ - if (!Mnt) - return -1; - - DrvTrait.fPacket.fPacketGood = false; - - switch (DrvIndex) - { - case kNewFSSubDriveA: { - NEWFS_WRITE(A, DrvTrait.fPacket, Mnt); - break; - } - case kNewFSSubDriveB: { - NEWFS_WRITE(B, DrvTrait.fPacket, Mnt); - break; - } - case kNewFSSubDriveC: { - NEWFS_WRITE(C, DrvTrait.fPacket, Mnt); - break; - } - case kNewFSSubDriveD: { - NEWFS_WRITE(D, DrvTrait.fPacket, Mnt); - break; - } - } - - return DrvTrait.fPacket.fPacketGood; -} - -#endif // ifdef __FSKIT_USE_NEWFS__ |
