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/IFS.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/IFS.cc')
| -rw-r--r-- | dev/kernel/src/IFS.cc | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/dev/kernel/src/IFS.cc b/dev/kernel/src/IFS.cc deleted file mode 100644 index 4679b8a3..00000000 --- a/dev/kernel/src/IFS.cc +++ /dev/null @@ -1,89 +0,0 @@ -/* ======================================== - - Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license. - -======================================== */ - -#include <KernelKit/DriveMgr.h> -#include <KernelKit/FileMgr.h> - -/************************************************************* - * - * File: IFS.cc - * Purpose: Filesystem to mountpoint interface. - * Date: 05/26/2025 - * - * Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license. - * - *************************************************************/ - -/// Useful macros regarding the IFS. - -#define fsi_ifs_write(DRV, TRAITS, MP) (MP->DRV()).fOutput(TRAITS) -#define fsi_ifs_read(DRV, TRAITS, MP) (MP->DRV()).fInput(TRAITS) - -namespace Kernel { -/// @brief Read from fs disk. -/// @param Mnt mounted interface. -/// @param DrvTrait drive info -/// @param DrvIndex drive index. -/// @return -Int32 fs_ifs_read(IMountpoint* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex) { - if (!Mnt) return kErrorDisk; - - DrvTrait.fPacket.fPacketGood = false; - - switch (DrvIndex) { - case IMountpoint::kDriveIndexA: { - fsi_ifs_read(A, DrvTrait.fPacket, Mnt); - break; - } - case IMountpoint::kDriveIndexB: { - fsi_ifs_read(B, DrvTrait.fPacket, Mnt); - break; - } - case IMountpoint::kDriveIndexC: { - fsi_ifs_read(C, DrvTrait.fPacket, Mnt); - break; - } - case IMountpoint::kDriveIndexD: { - fsi_ifs_read(D, DrvTrait.fPacket, Mnt); - break; - } - } - - return DrvTrait.fPacket.fPacketGood ? kErrorSuccess : kErrorDisk; -} - -/// @brief Write to fs disk. -/// @param Mnt mounted interface. -/// @param DrvTrait drive info -/// @param DrvIndex drive index. -/// @return -Int32 fs_ifs_write(IMountpoint* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex) { - if (!Mnt) return kErrorDisk; - - DrvTrait.fPacket.fPacketGood = false; - - switch (DrvIndex) { - case IMountpoint::kDriveIndexA: { - fsi_ifs_write(A, DrvTrait.fPacket, Mnt); - break; - } - case IMountpoint::kDriveIndexB: { - fsi_ifs_write(B, DrvTrait.fPacket, Mnt); - break; - } - case IMountpoint::kDriveIndexC: { - fsi_ifs_write(C, DrvTrait.fPacket, Mnt); - break; - } - case IMountpoint::kDriveIndexD: { - fsi_ifs_write(D, DrvTrait.fPacket, Mnt); - break; - } - } - - return DrvTrait.fPacket.fPacketGood ? kErrorSuccess : kErrorDisk; -} -} // namespace Kernel
\ No newline at end of file |
