diff options
| author | Amlal <amlal@el-mahrouss-logic.com> | 2024-09-22 17:46:11 +0200 |
|---|---|---|
| committer | Amlal <amlal@el-mahrouss-logic.com> | 2024-09-22 17:46:11 +0200 |
| commit | 8719b4570a2d10dd49a0d3a47e24f5c55bdda85e (patch) | |
| tree | ba095740888f3768e08b2ea058b0ea6da2d0403d /dev/zka/HALKit/ARM64/Storage | |
| parent | 45944b3d2dab04b763fcc6d10164fe8069e60b08 (diff) | |
:boom: A big refactor on the filesystem structure.
Signed-off-by: Amlal <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'dev/zka/HALKit/ARM64/Storage')
| -rw-r--r-- | dev/zka/HALKit/ARM64/Storage/.gitkeep | 0 | ||||
| -rw-r--r-- | dev/zka/HALKit/ARM64/Storage/HalFlash.cxx | 66 |
2 files changed, 66 insertions, 0 deletions
diff --git a/dev/zka/HALKit/ARM64/Storage/.gitkeep b/dev/zka/HALKit/ARM64/Storage/.gitkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/dev/zka/HALKit/ARM64/Storage/.gitkeep diff --git a/dev/zka/HALKit/ARM64/Storage/HalFlash.cxx b/dev/zka/HALKit/ARM64/Storage/HalFlash.cxx new file mode 100644 index 00000000..a479da93 --- /dev/null +++ b/dev/zka/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 __USE_MBCI_FLASH__ + +#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_get_sector_count(Int32 slot) + { + if (slot > cMaxFlash) + return 0; + + return kFlashSectorSz[slot]; + } + + /// @brief get device size. + /// @return drive size + SizeT drv_get_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 << "Enabled FLSH hardware.\r"; + } + + /// @brief Disable flash memory at slot. + STATIC Void drv_disable_flash(Int32 arg) + { + kcout << "Disabled FLSH hardware.\r"; + } +} // namespace Kernel + +#endif // if __USE_MBCI_FLASH__ (Bridge) |
