diff --git a/drivers/nvme/nvme.asm b/drivers/nvme/nvme.asm index 7de2678..0c88d7a 100644 --- a/drivers/nvme/nvme.asm +++ b/drivers/nvme/nvme.asm @@ -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