1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +00:00

Kernel/Storage: Use more locking in the IDE code

This change should make it less possible for race conditions to happen
and cause fatal errors when accessing the hardware.
This commit is contained in:
Liav A 2021-03-27 09:53:59 +03:00 committed by Andreas Kling
parent 8b446fb579
commit b96e4c1308
3 changed files with 58 additions and 44 deletions

View file

@ -163,10 +163,11 @@ protected:
RefPtr<StorageDevice> m_master;
RefPtr<StorageDevice> m_slave;
AsyncBlockDeviceRequest* m_current_request { nullptr };
u32 m_current_request_block_index { 0 };
RefPtr<AsyncBlockDeviceRequest> m_current_request;
size_t m_current_request_block_index { 0 };
bool m_current_request_flushing_cache { false };
SpinLock<u8> m_request_lock;
Lock m_lock { "IDEChannel" };
IOAddressGroup m_io_group;
NonnullRefPtr<IDEController> m_parent_controller;