mirror of
https://git.missingno.dev/kolibrios-nvme-driver/
synced 2025-01-22 05:08:16 +01:00
fix: initialize command mutexes correctly
This commit is contained in:
parent
0cbf662a9f
commit
d36f13f7af
@ -750,11 +750,12 @@ proc nvme_init stdcall, pci:dword
|
|||||||
invoke KernelAlloc, sizeof.MUTEX
|
invoke KernelAlloc, sizeof.MUTEX
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jz .exit_fail
|
jz .exit_fail
|
||||||
mov dword [esi + ebx * NVMQCMD.mutex_ptr], eax
|
mov dword [esi + NVMQCMD.mutex_ptr], eax
|
||||||
mov dword [esi + ebx * NVMQCMD.cid], ebx
|
mov dword [esi + NVMQCMD.cid], ebx
|
||||||
mov ecx, eax
|
mov ecx, eax
|
||||||
invoke MutexInit
|
invoke MutexInit
|
||||||
inc ebx
|
inc ebx
|
||||||
|
add esi, sizeof.NVMQCMD
|
||||||
cmp ebx, CQ_ENTRIES
|
cmp ebx, CQ_ENTRIES
|
||||||
jne .init_cmd_entries
|
jne .init_cmd_entries
|
||||||
|
|
||||||
@ -1081,18 +1082,18 @@ proc sqytdbl_write stdcall, pci:dword, y:word, cmd:dword
|
|||||||
movzx ebx, [y]
|
movzx ebx, [y]
|
||||||
imul ebx, sizeof.NVM_QUEUE_ENTRY
|
imul ebx, sizeof.NVM_QUEUE_ENTRY
|
||||||
lea edi, [edi + ebx]
|
lea edi, [edi + ebx]
|
||||||
;mov eax, dword [edi + NVM_QUEUE_ENTRY.cmd_ptr]
|
mov eax, dword [edi + NVM_QUEUE_ENTRY.cmd_ptr]
|
||||||
mov edx, dword [edi + NVM_QUEUE_ENTRY.sq_ptr]
|
mov edx, dword [edi + NVM_QUEUE_ENTRY.sq_ptr]
|
||||||
mov esi, [cmd]
|
mov esi, [cmd]
|
||||||
mov ecx, dword [esi + SQ_ENTRY.cdw0]
|
mov ecx, dword [esi + SQ_ENTRY.cdw0]
|
||||||
shr ecx, 16 ; Get CID
|
shr ecx, 16 ; Get CID
|
||||||
imul ecx, sizeof.SQ_ENTRY
|
imul ecx, sizeof.SQ_ENTRY
|
||||||
lea edx, [edx + ecx]
|
lea edx, [edx + ecx]
|
||||||
;mov ecx, dword [eax + ecx + NVMQCMD.mutex_ptr]
|
mov ecx, dword [eax + ecx + NVMQCMD.mutex_ptr]
|
||||||
;push ecx
|
push ecx
|
||||||
stdcall memcpyd, edx, esi, sizeof.SQ_ENTRY / 4
|
stdcall memcpyd, edx, esi, sizeof.SQ_ENTRY / 4
|
||||||
;pop ecx
|
pop ecx
|
||||||
;invoke MutexLock
|
invoke MutexLock
|
||||||
|
|
||||||
mov esi, [pci]
|
mov esi, [pci]
|
||||||
movzx eax, word [edi + NVM_QUEUE_ENTRY.tail]
|
movzx eax, word [edi + NVM_QUEUE_ENTRY.tail]
|
||||||
|
Loading…
Reference in New Issue
Block a user