2
0
mirror of https://git.missingno.dev/kolibrios-nvme-driver/ synced 2024-12-22 05:48:47 +01:00

fix: allocate correct number of PRPs for PRP list

This commit is contained in:
Abdur-Rahman Mansoor 2024-08-26 17:19:26 -04:00
parent bd93b426c0
commit 3d95901b65
Signed by: ramenu
GPG Key ID: 8D15FCF6795779C8

View File

@ -325,7 +325,7 @@ proc build_prp_list stdcall, nprps:dword, buf:dword, prp_list_ptr:dword
mov eax, esi
invoke GetPhysAddr
mov dword [edi + ecx * 8], eax
mov dword [edi + ecx * 8 - 4], 0
mov dword [edi + ecx * 8 + 4], 0
add esi, PAGE_SIZE
inc ecx
cmp ecx, ebx
@ -416,6 +416,11 @@ proc alloc_dptr stdcall, ns:dword, prps_ptr:dword, numsectors:dword, prp_list_pt
mov eax, [numsectors]
xor edx, edx
div ecx
test [buf], PAGE_SIZE - 1
jz @f
inc eax
@@:
stdcall build_prp_list, eax, ebx, [prp_list_ptr]
test eax, eax
jz .err