summaryrefslogtreecommitdiffhomepage
path: root/Kernel/HALKit/ARM64/Storage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-06-20 11:00:20 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-06-20 11:00:20 +0200
commit120580707d93bf15de4affb3c3af489a6f1fcc0d (patch)
treef0da87e86b4fc30b32caaea800724fd31e31467c /Kernel/HALKit/ARM64/Storage
parentf958113a684df8f34c1677fcc41783054bd301cf (diff)
ARM64: Adding virtual memory support.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Kernel/HALKit/ARM64/Storage')
-rw-r--r--Kernel/HALKit/ARM64/Storage/Flash.cxx28
-rw-r--r--Kernel/HALKit/ARM64/Storage/HalFlash.cxx52
2 files changed, 52 insertions, 28 deletions
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 <NewKit/Defines.hpp>
-#include <ArchKit/ArchKit.hpp>
-
-/// @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 <NewKit/Defines.hpp>
+#include <ArchKit/ArchKit.hpp>
+
+/// @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)