From 120580707d93bf15de4affb3c3af489a6f1fcc0d Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 20 Jun 2024 11:00:20 +0200 Subject: ARM64: Adding virtual memory support. Signed-off-by: Amlal El Mahrouss --- Kernel/HALKit/ARM64/Storage/Flash.cxx | 28 ----------------- Kernel/HALKit/ARM64/Storage/HalFlash.cxx | 52 ++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 28 deletions(-) delete mode 100644 Kernel/HALKit/ARM64/Storage/Flash.cxx create mode 100644 Kernel/HALKit/ARM64/Storage/HalFlash.cxx (limited to 'Kernel/HALKit/ARM64/Storage') diff --git a/Kernel/HALKit/ARM64/Storage/Flash.cxx b/Kernel/HALKit/ARM64/Storage/Flash.cxx deleted file mode 100644 index 666dfc0b..00000000 --- a/Kernel/HALKit/ARM64/Storage/Flash.cxx +++ /dev/null @@ -1,28 +0,0 @@ -/* ------------------------------------------- - - Copyright Zeta Electronics Corporation - -------------------------------------------- */ - -#include -#include - -/// @file Flash.cxx -/// @brief Flash memory builtin. - -#ifdef __FLASH_MEM__ - -namespace NewOS -{ - SizeT drv_std_get_sector_count(void) - { - return 0; - } - - SizeT drv_std_get_drv_size(void) - { - return 0; - } -} // namespace NewOS - -#endif // if __FLASH_MEM__ (Bridge) diff --git a/Kernel/HALKit/ARM64/Storage/HalFlash.cxx b/Kernel/HALKit/ARM64/Storage/HalFlash.cxx new file mode 100644 index 00000000..7bc9c8c0 --- /dev/null +++ b/Kernel/HALKit/ARM64/Storage/HalFlash.cxx @@ -0,0 +1,52 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + +------------------------------------------- */ + +#include +#include + +/// @file Flash.cxx +/// @brief Flash memory builtin. + +#ifdef __FLASH_MEM__ + +namespace NewOS +{ + /// /:\\BRIDGE\\FLSH\\1 + constexpr auto cFlashBridgeMagic = "FLSH"; + constexpr auto cFlashBridgeRevision = 1; + + STATIC const Boolean kFlashEnabled = No; + STATIC SizeT kFlashSize = 0UL; + STATIC SizeT kFlashSectorSz = 0UL; + + /// @brief Enable flash memory builtin. + STATIC Void drv_enable_builtin(Void); + + /// @brief Disable flash memory builtin. + STATIC Void drv_disable_builtin(Void); + + /// @brief get sector count. + /// @return drive sector count. + SizeT drv_std_get_sector_count(void) + { + return kFlashSectorSz; + } + + /// @brief get device size. + /// @return drive size + SizeT drv_std_get_drv_size(void) + { + return kFlashSize; + } + + /// @brief Enable flash memory builtin. + STATIC Void drv_enable_builtin(Void) {} + + /// @brief Disable flash memory builtin. + STATIC Void drv_disable_builtin(Void) {} +} // namespace NewOS + +#endif // if __FLASH_MEM__ (Bridge) -- cgit v1.2.3