diff options
Diffstat (limited to 'Private/StorageKit')
| -rw-r--r-- | Private/StorageKit/Storage.hpp | 9 | ||||
| -rw-r--r-- | Private/StorageKit/StorageCore.inl | 70 |
2 files changed, 31 insertions, 48 deletions
diff --git a/Private/StorageKit/Storage.hpp b/Private/StorageKit/Storage.hpp index 8b3670af..568a9d25 100644 --- a/Private/StorageKit/Storage.hpp +++ b/Private/StorageKit/Storage.hpp @@ -10,19 +10,14 @@ #pragma once #include <NewKit/Defines.hpp> - #include <StorageKit/ATA.hpp> #include <StorageKit/NVME.hpp> -#include <StorageKit/StorageCore.inl> - typedef hCore::UInt16 OSScsiPacket[12]; extern const OSScsiPacket kCDRomPacketTemplate; -#define f_kDriveSectorSize 2048 +#define f_kDriveSectorSize 512 #define f_kDriveSize(last_lba) ((last_lba + 1) * f_kDriveSectorSize) - - - +#include <StorageKit/StorageCore.inl> diff --git a/Private/StorageKit/StorageCore.inl b/Private/StorageKit/StorageCore.inl index 85e2a3f5..73e89a9d 100644 --- a/Private/StorageKit/StorageCore.inl +++ b/Private/StorageKit/StorageCore.inl @@ -6,51 +6,39 @@ * * ======================================================== */ - + #ifndef __STORAGEKIT_STORAGECORE_INL__ #define __STORAGEKIT_STORAGECORE_INL__ #include <NewKit/Defines.hpp> -// @brief Storage management unit. -// swap files, files, dirs optimization. - -namespace hCore -{ - typedef Char* SKStr; - - //! @brief Storage context, reads and write file according to the descriptor layout. - class StorageContext - { - public: - explicit StorageContext() = default; - ~StorageContext() = default; - - StorageContext& operator=(const StorageContext&) = default; - StorageContext(const StorageContext&) = default; - - public: - bool Write(VoidPtr fileDescriptor, SizeT sizeFileDescriptor); - - struct SDescriptor - { - VoidPtr fFilePtr; - SizeT fFilePtrSz; - }; - - SDescriptor Read(const SKStr name); - - }; - -#define kMaxPathSK 4096 - - struct StorageLayout final - { - Char fName[kMaxPathSK]; - VoidPtr fData; - SizeT fDataSz; - Int32 fType; - }; -} +/// @file StorageCore.inl +/// @brief Storage Management API. + +namespace hCore { +typedef Char* SKStr; + +///! @brief Storage context, reads and write file according to the descriptor +///! layout. +class StorageContext { + public: + explicit StorageContext() = default; + ~StorageContext() = default; + + StorageContext& operator=(const StorageContext&) = default; + StorageContext(const StorageContext&) = default; + + public: + bool Write(VoidPtr fileDescriptor, SizeT sizeFileDescriptor); + + struct PacketDescriptor final { + VoidPtr fFilePtr; + SizeT fFilePtrSz; + }; + + PacketDescriptor* Read(const SKStr name); + Int32 Write(PacketDescriptor* packet, const SKStr name); +}; +} // namespace hCore #endif /* ifndef __STORAGEKIT_STORAGECORE_INL__ */ |
