diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-06-21 05:55:02 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-06-21 05:56:26 +0200 |
| commit | f3432c10bd694344f7e1f82ed8cd793358f1a400 (patch) | |
| tree | b2ac11c9c1378cb24e046185b6d2eeb1b0e16e98 /Kernel/HALKit | |
| parent | 3a11be8c6f15cb03b483e2693bcd244846c6d61d (diff) | |
IMP: protect other computers which doesnt support EPM layout (AMD64)
IMP: Add LTE builtin and NetworkDevice of type LTE.
UPDATE: Also updated ReadMe.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Kernel/HALKit')
| -rw-r--r-- | Kernel/HALKit/ARM64/Storage/HalFlash.cxx | 54 |
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) |
