mirror of
https://git.missingno.dev/kolibrios-nvme-driver/
synced 2025-01-03 19:35:56 +01:00
add sqytdbl_write
and cqyhdbl_write
This commit is contained in:
parent
1197535b9c
commit
a0cc2ec6a5
@ -337,7 +337,7 @@ proc nvme_init stdcall, pci:dword
|
|||||||
|
|
||||||
; Attach interrupt handler
|
; Attach interrupt handler
|
||||||
movzx eax, byte [esi + pcidev.iline]
|
movzx eax, byte [esi + pcidev.iline]
|
||||||
invoke AttachIntHandler, eax, irq_handler, 0
|
invoke AttachIntHandler, eax, irq_handler, esi
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jz .exit_fail
|
jz .exit_fail
|
||||||
DEBUGF DBG_INFO, "(NVMe) Successfully attached interrupt handler\n"
|
DEBUGF DBG_INFO, "(NVMe) Successfully attached interrupt handler\n"
|
||||||
@ -411,14 +411,31 @@ proc nvme_wait stdcall, mmio:dword
|
|||||||
|
|
||||||
endp
|
endp
|
||||||
|
|
||||||
proc cq0thbl_write stdcall, mmio:dword, dstrd:dword
|
; Writes to completion queue 'y' head doorbell
|
||||||
|
proc cqyhdbl_write stdcall, mmio:dword, dstrd:byte, y:byte
|
||||||
|
|
||||||
; 1000h + (2 * (4 << CAP.DSTRD))
|
; 1000h + ((2y + 1) * (4 << CAP.DSTRD))
|
||||||
mov eax, [dstrd]
|
xor ecx, ecx
|
||||||
shl eax, 4
|
shl ecx, [y]
|
||||||
imul eax, 2
|
inc ecx
|
||||||
|
mov eax, 4
|
||||||
|
shl eax, [dstrd]
|
||||||
|
imul eax, ecx
|
||||||
add eax, 0x1000
|
add eax, 0x1000
|
||||||
|
ret
|
||||||
|
|
||||||
|
endp
|
||||||
|
|
||||||
|
; Writes to submission queue 'y' tail doorbell
|
||||||
|
proc sqytdbl_write stdcall, mmio:dword, dstrd:byte, y:byte
|
||||||
|
|
||||||
|
; 1000h + (2y * (4 << CAP.DSTRD))
|
||||||
|
xor ecx, ecx
|
||||||
|
shl ecx, [y]
|
||||||
|
mov eax, 4
|
||||||
|
shl eax, [dstrd]
|
||||||
|
imul eax, ecx
|
||||||
|
add eax, 0x1000
|
||||||
ret
|
ret
|
||||||
|
|
||||||
endp
|
endp
|
||||||
|
Loading…
Reference in New Issue
Block a user