2
0
mirror of https://git.missingno.dev/kolibrios-nvme-driver/ synced 2025-01-22 05:08:16 +01:00

refactor: allocate ring buffers for submission/completion queues

This commit is contained in:
Abdur-Rahman Mansoor 2024-06-21 14:17:18 -04:00
parent a1a24073c3
commit 5b1f690ef2

View File

@ -517,7 +517,7 @@ proc nvme_init stdcall, pci:dword
push esi
mov esi, dword [esi + pcidev.queue_entries]
; TODO: Allocate ring buffer? (see page 8 of NVMe 1.4 spec)
invoke KernelAlloc, 0x1000
invoke CreateRingBuffer, 0x1000, PG_SW
test eax, eax
jz .exit_fail
mov dword [esi + NVM_QUEUE_ENTRY.sq_ptr], eax
@ -525,7 +525,7 @@ proc nvme_init stdcall, pci:dword
mov dword [edi + NVME_MMIO.ASQ], eax
and dword [edi + NVME_MMIO.ASQ + 4], 0
; TODO: Allocate ring buffer? (see page 8 of NVMe 1.4 spec)
invoke KernelAlloc, 0x1000
invoke CreateRingBuffer, 0x1000, PG_SW
test eax, eax
jz .exit_fail
mov dword [esi + NVM_QUEUE_ENTRY.cq_ptr], eax
@ -612,13 +612,13 @@ proc nvme_init stdcall, pci:dword
mov esi, [pci]
mov esi, dword [esi + pcidev.queue_entries]
lea esi, [esi + sizeof.NVM_QUEUE_ENTRY]
invoke KernelAlloc, 0x1000
invoke CreateRingBuffer, 0x1000, PG_SW
test eax, eax
jz .exit_fail
mov dword [esi + NVM_QUEUE_ENTRY.cq_ptr], eax
invoke GetPhysAddr
stdcall create_io_completion_queue, [pci], eax, 1, IEN_ON
invoke KernelAlloc, 0x1000
invoke CreateRingBuffer, 0x1000, PG_SW
test eax, eax
jz .exit_fail
mov dword [esi + NVM_QUEUE_ENTRY.sq_ptr], eax