1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 05:15:06 +00:00
serenity/Kernel/Devices/Storage/NVMe/NVMePollQueue.h
Idan Horowitz 03cb3e5370 Kernel: Move NVMeQueue's m_cq_lock to NVMePollQueue
It's only used by that subclass, so there's no reason for it to be
defined as part of the parent class.
2024-02-10 08:42:53 +01:00

25 lines
921 B
C++

/*
* Copyright (c) 2022, Pankaj R <pankydev8@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <Kernel/Devices/Storage/NVMe/NVMeQueue.h>
namespace Kernel {
class NVMePollQueue : public NVMeQueue {
public:
static ErrorOr<NonnullLockRefPtr<NVMePollQueue>> try_create(NonnullOwnPtr<Memory::Region> rw_dma_region, NonnullRefPtr<Memory::PhysicalPage> rw_dma_page, u16 qid, u32 q_depth, OwnPtr<Memory::Region> cq_dma_region, OwnPtr<Memory::Region> sq_dma_region, Doorbell db_regs);
void submit_sqe(NVMeSubmission& submission) override;
virtual ~NVMePollQueue() override {};
protected:
NVMePollQueue(NonnullOwnPtr<Memory::Region> rw_dma_region, NonnullRefPtr<Memory::PhysicalPage> rw_dma_page, u16 qid, u32 q_depth, OwnPtr<Memory::Region> cq_dma_region, OwnPtr<Memory::Region> sq_dma_region, Doorbell db_regs);
private:
Spinlock<LockRank::Interrupts> m_cq_lock {};
};
}