diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-15 18:35:34 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-15 18:35:34 +0200 |
| commit | f3d931aa7cfaf96baef8383b59a8938779541ee7 (patch) | |
| tree | fdb9fc51badb3dbd03e46ab0766a49d9522e13e2 /dev/Kernel/HALKit/ARM64/Storage | |
| parent | 86640816e8b1d3595365f1fcc8a2a9e61fb40ff1 (diff) | |
[IMP] Moved source code into dev/ folder.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/HALKit/ARM64/Storage')
| -rw-r--r-- | dev/Kernel/HALKit/ARM64/Storage/.gitkeep | 0 | ||||
| -rw-r--r-- | dev/Kernel/HALKit/ARM64/Storage/HalFlash.cxx | 66 |
2 files changed, 66 insertions, 0 deletions
diff --git a/dev/Kernel/HALKit/ARM64/Storage/.gitkeep b/dev/Kernel/HALKit/ARM64/Storage/.gitkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/dev/Kernel/HALKit/ARM64/Storage/.gitkeep diff --git a/dev/Kernel/HALKit/ARM64/Storage/HalFlash.cxx b/dev/Kernel/HALKit/ARM64/Storage/HalFlash.cxx new file mode 100644 index 00000000..cc7802cb --- /dev/null +++ b/dev/Kernel/HALKit/ARM64/Storage/HalFlash.cxx @@ -0,0 +1,66 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies. + +------------------------------------------- */ + +#include <NewKit/Defines.hxx> +#include <ArchKit/ArchKit.hxx> + +/// @file Flash.cxx +/// @brief Flash memory builtin. + +#ifdef __FLASH_MEM__ + +#define cMaxFlash (4U) + +namespace Kernel +{ + /// /:\\BRIDGE\\FLSH\\1 + constexpr auto cFlashBridgeMagic = "FLSH"; + constexpr auto cFlashBridgeRevision = 1; + + STATIC const Boolean kFlashEnabled = No; + STATIC SizeT kFlashSize[cMaxFlash] = {}; + STATIC SizeT kFlashSectorSz[cMaxFlash] = {}; + + /// @brief Enable flash memory builtin. + STATIC Void drv_enable_flash(Int32 slot); + + /// @brief Disable flash memory builtin. + STATIC Void drv_disable_flash(Int32 slot); + + /// @brief get sector count. + /// @return drive sector count. + SizeT drv_std_get_sector_count(Int32 slot) + { + if (slot > cMaxFlash) + return 0; + + return kFlashSectorSz[slot]; + } + + /// @brief get device size. + /// @return drive size + SizeT drv_std_get_drv_size(Int32 slot) + { + if (slot > cMaxFlash) + return 0; + + return kFlashSize[slot]; + } + + /// @brief Enable flash memory at slot. + STATIC Void drv_enable_flash(Int32 arg) + { + kcout << "newoskrnl: enabled hardware.\r"; + } + + /// @brief Disable flash memory at slot. + STATIC Void drv_disable_flash(Int32 arg) + { + kcout << "newoskrnl: disabled hardware.\r"; + } +} // namespace Kernel + +#endif // if __FLASH_MEM__ (Bridge) |
