diff options
Diffstat (limited to 'Kernel/Storage/NVMe/NVMeQueue.h')
-rw-r--r-- | Kernel/Storage/NVMe/NVMeQueue.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Kernel/Storage/NVMe/NVMeQueue.h b/Kernel/Storage/NVMe/NVMeQueue.h index aa0e3727dc..7f1a792079 100644 --- a/Kernel/Storage/NVMe/NVMeQueue.h +++ b/Kernel/Storage/NVMe/NVMeQueue.h @@ -7,13 +7,13 @@ #pragma once #include <AK/AtomicRefCounted.h> -#include <AK/NonnullRefPtr.h> -#include <AK/NonnullRefPtrVector.h> #include <AK/OwnPtr.h> -#include <AK/RefPtr.h> #include <AK/Types.h> #include <Kernel/Bus/PCI/Device.h> #include <Kernel/Interrupts/IRQHandler.h> +#include <Kernel/Library/LockRefPtr.h> +#include <Kernel/Library/NonnullLockRefPtr.h> +#include <Kernel/Library/NonnullLockRefPtrVector.h> #include <Kernel/Locking/Spinlock.h> #include <Kernel/Memory/MemoryManager.h> #include <Kernel/Memory/TypedMapping.h> @@ -29,7 +29,7 @@ struct DoorbellRegister { class AsyncBlockDeviceRequest; class NVMeQueue : public AtomicRefCounted<NVMeQueue> { public: - static ErrorOr<NonnullRefPtr<NVMeQueue>> try_create(u16 qid, Optional<u8> irq, u32 q_depth, OwnPtr<Memory::Region> cq_dma_region, NonnullRefPtrVector<Memory::PhysicalPage> cq_dma_page, OwnPtr<Memory::Region> sq_dma_region, NonnullRefPtrVector<Memory::PhysicalPage> sq_dma_page, Memory::TypedMapping<DoorbellRegister volatile> db_regs); + static ErrorOr<NonnullLockRefPtr<NVMeQueue>> try_create(u16 qid, Optional<u8> irq, u32 q_depth, OwnPtr<Memory::Region> cq_dma_region, NonnullLockRefPtrVector<Memory::PhysicalPage> cq_dma_page, OwnPtr<Memory::Region> sq_dma_region, NonnullLockRefPtrVector<Memory::PhysicalPage> sq_dma_page, Memory::TypedMapping<DoorbellRegister volatile> db_regs); bool is_admin_queue() { return m_admin_queue; }; u16 submit_sync_sqe(NVMeSubmission&); void read(AsyncBlockDeviceRequest& request, u16 nsid, u64 index, u32 count); @@ -43,7 +43,7 @@ protected: { m_db_regs->sq_tail = m_sq_tail; } - NVMeQueue(NonnullOwnPtr<Memory::Region> rw_dma_region, Memory::PhysicalPage const& rw_dma_page, u16 qid, u32 q_depth, OwnPtr<Memory::Region> cq_dma_region, NonnullRefPtrVector<Memory::PhysicalPage> cq_dma_page, OwnPtr<Memory::Region> sq_dma_region, NonnullRefPtrVector<Memory::PhysicalPage> sq_dma_page, Memory::TypedMapping<DoorbellRegister volatile> db_regs); + NVMeQueue(NonnullOwnPtr<Memory::Region> rw_dma_region, Memory::PhysicalPage const& rw_dma_page, u16 qid, u32 q_depth, OwnPtr<Memory::Region> cq_dma_region, NonnullLockRefPtrVector<Memory::PhysicalPage> cq_dma_page, OwnPtr<Memory::Region> sq_dma_region, NonnullLockRefPtrVector<Memory::PhysicalPage> sq_dma_page, Memory::TypedMapping<DoorbellRegister volatile> db_regs); private: bool cqe_available(); @@ -56,7 +56,7 @@ private: protected: Spinlock m_cq_lock { LockRank::Interrupts }; - RefPtr<AsyncBlockDeviceRequest> m_current_request; + LockRefPtr<AsyncBlockDeviceRequest> m_current_request; NonnullOwnPtr<Memory::Region> m_rw_dma_region; Spinlock m_request_lock { LockRank::None }; @@ -70,12 +70,12 @@ private: u32 m_qdepth {}; Spinlock m_sq_lock { LockRank::Interrupts }; OwnPtr<Memory::Region> m_cq_dma_region; - NonnullRefPtrVector<Memory::PhysicalPage> m_cq_dma_page; + NonnullLockRefPtrVector<Memory::PhysicalPage> m_cq_dma_page; Span<NVMeSubmission> m_sqe_array; OwnPtr<Memory::Region> m_sq_dma_region; - NonnullRefPtrVector<Memory::PhysicalPage> m_sq_dma_page; + NonnullLockRefPtrVector<Memory::PhysicalPage> m_sq_dma_page; Span<NVMeCompletion> m_cqe_array; Memory::TypedMapping<DoorbellRegister volatile> m_db_regs; - NonnullRefPtr<Memory::PhysicalPage> m_rw_dma_page; + NonnullLockRefPtr<Memory::PhysicalPage> m_rw_dma_page; }; } |