summaryrefslogtreecommitdiffhomepage
path: root/Kernel/HALKit
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/HALKit')
-rw-r--r--Kernel/HALKit/ARM64/Storage/HalFlash.cxx54
1 files changed, 34 insertions, 20 deletions
diff --git a/Kernel/HALKit/ARM64/Storage/HalFlash.cxx b/Kernel/HALKit/ARM64/Storage/HalFlash.cxx
index 7bc9c8c0..4466963e 100644
--- a/Kernel/HALKit/ARM64/Storage/HalFlash.cxx
+++ b/Kernel/HALKit/ARM64/Storage/HalFlash.cxx
@@ -12,41 +12,55 @@
#ifdef __FLASH_MEM__
+#define cMaxFlash (4U)
+
namespace NewOS
{
- /// /:\\BRIDGE\\FLSH\\1
- constexpr auto cFlashBridgeMagic = "FLSH";
- constexpr auto cFlashBridgeRevision = 1;
+ /// /:\\BRIDGE\\FLSH\\1
+ constexpr auto cFlashBridgeMagic = "FLSH";
+ constexpr auto cFlashBridgeRevision = 1;
- STATIC const Boolean kFlashEnabled = No;
- STATIC SizeT kFlashSize = 0UL;
- STATIC SizeT kFlashSectorSz = 0UL;
+ STATIC const Boolean kFlashEnabled = No;
+ STATIC SizeT kFlashSize[cMaxFlash] = {};
+ STATIC SizeT kFlashSectorSz[cMaxFlash] = {};
- /// @brief Enable flash memory builtin.
- STATIC Void drv_enable_builtin(Void);
+ /// @brief Enable flash memory builtin.
+ STATIC Void drv_enable_flash(Int32 slot);
- /// @brief Disable flash memory builtin.
- STATIC Void drv_disable_builtin(Void);
+ /// @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(void)
+ /// @brief get sector count.
+ /// @return drive sector count.
+ SizeT drv_std_get_sector_count(Int32 slot)
{
- return kFlashSectorSz;
+ if (slot > cMaxFlash)
+ return 0;
+
+ return kFlashSectorSz[slot];
}
/// @brief get device size.
/// @return drive size
- SizeT drv_std_get_drv_size(void)
+ SizeT drv_std_get_drv_size(Int32 slot)
{
- return kFlashSize;
+ if (slot > cMaxFlash)
+ return 0;
+
+ return kFlashSize[slot];
}
- /// @brief Enable flash memory builtin.
- STATIC Void drv_enable_builtin(Void) {}
+ /// @brief Enable flash memory at slot.
+ STATIC Void drv_enable_flash(Int32 arg)
+ {
+ kcout << "newoskrnl: enabled hardware.\r";
+ }
- /// @brief Disable flash memory builtin.
- STATIC Void drv_disable_builtin(Void) {}
+ /// @brief Disable flash memory at slot.
+ STATIC Void drv_disable_flash(Int32 arg)
+ {
+ kcout << "newoskrnl: disabled hardware.\r";
+ }
} // namespace NewOS
#endif // if __FLASH_MEM__ (Bridge)