mirror of
https://git.missingno.dev/kolibrios-nvme-driver/
synced 2025-02-07 12:46:51 +01:00
feat: add support for consuming completion queues entries from multiple queues
This commit is contained in:
parent
ef8087f2fd
commit
5bc4a832f1
@ -1023,6 +1023,8 @@ proc is_queue_full stdcall, tail:word, head:word
|
|||||||
push bx
|
push bx
|
||||||
mov ax, [tail]
|
mov ax, [tail]
|
||||||
mov bx, [head]
|
mov bx, [head]
|
||||||
|
cmp ax, bx
|
||||||
|
je .not_full
|
||||||
test bx, bx
|
test bx, bx
|
||||||
jnz @f
|
jnz @f
|
||||||
cmp ax, NVM_ASQS
|
cmp ax, NVM_ASQS
|
||||||
@ -1033,15 +1035,15 @@ proc is_queue_full stdcall, tail:word, head:word
|
|||||||
|
|
||||||
@@:
|
@@:
|
||||||
cmp ax, bx
|
cmp ax, bx
|
||||||
jge @f
|
jge .not_full
|
||||||
sub ax, bx
|
sub ax, bx
|
||||||
cmp ax, 1
|
cmp ax, 1
|
||||||
jne @f
|
jne .not_full
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
inc eax
|
inc eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@:
|
.not_full:
|
||||||
pop bx
|
pop bx
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
@ -1093,10 +1095,18 @@ proc irq_handler
|
|||||||
mov edi, esi
|
mov edi, esi
|
||||||
mov edi, dword [edi + pcidev.io_addr]
|
mov edi, dword [edi + pcidev.io_addr]
|
||||||
mov dword [edi + NVME_MMIO.INTMS], 0x3
|
mov dword [edi + NVME_MMIO.INTMS], 0x3
|
||||||
stdcall consume_cq_entries, [p_nvme_devices], 0
|
xor ecx, ecx
|
||||||
mov dword [edi + NVME_MMIO.INTMC], 0x3
|
|
||||||
|
@@:
|
||||||
|
push ecx
|
||||||
|
stdcall consume_cq_entries, [p_nvme_devices], ecx
|
||||||
|
pop ecx
|
||||||
|
inc ecx
|
||||||
|
cmp ecx, LAST_QUEUE_ID
|
||||||
|
jne @b
|
||||||
|
|
||||||
; Interrupt handled by driver, return 1
|
; Interrupt handled by driver, return 1
|
||||||
|
mov dword [edi + NVME_MMIO.INTMC], 0x3
|
||||||
pop edi esi
|
pop edi esi
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
inc eax
|
inc eax
|
||||||
|
@ -20,6 +20,7 @@ NVM_CMDS = 64 ; Number of Commands
|
|||||||
NVM_MPS = 0 ; Memory Page Size (2 ^ (12 + MPS))
|
NVM_MPS = 0 ; Memory Page Size (2 ^ (12 + MPS))
|
||||||
NVM_ASQS = 63 ; Admin Submission Queue Size
|
NVM_ASQS = 63 ; Admin Submission Queue Size
|
||||||
NVM_ACQS = NVM_ASQS ; Admin Completion Queue Size
|
NVM_ACQS = NVM_ASQS ; Admin Completion Queue Size
|
||||||
|
LAST_QUEUE_ID = 1 ; Index of the last queue
|
||||||
|
|
||||||
ADMIN_QUEUE = 0 ; Admin Queue ID
|
ADMIN_QUEUE = 0 ; Admin Queue ID
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user