2
0
mirror of https://git.missingno.dev/kolibrios-nvme-driver/ synced 2024-12-23 06:18:47 +01:00

chore: add comments + save value of IDENTC.nn

This commit is contained in:
Abdur-Rahman Mansoor 2024-06-22 14:43:08 -04:00
parent bb59692ca4
commit 1c69e25c2b

View File

@ -178,6 +178,8 @@ proc determine_active_nsids stdcall, pci:dword
invoke GetPhysAddr invoke GetPhysAddr
stdcall nvme_identify, [pci], 0, eax, CNS_IDCS stdcall nvme_identify, [pci], 0, eax, CNS_IDCS
mov eax, dword [esi + IDENTC.nn] mov eax, dword [esi + IDENTC.nn]
mov edx, [pci]
mov dword [edx + pcidev.nn], eax
test eax, eax test eax, eax
jz .fail jz .fail
invoke KernelAlloc, 0x1000 invoke KernelAlloc, 0x1000
@ -191,10 +193,12 @@ proc determine_active_nsids stdcall, pci:dword
.loop: .loop:
cmp ecx, dword [esi + IDENTC.nn] cmp ecx, dword [esi + IDENTC.nn]
jg .success jg .success
stdcall nvme_identify, [pci], ecx, ebx, CNS_IDNS stdcall nvme_identify, [pci], ecx, ebx, CNS_IDNS ; identify N'th namespace
push ecx push ecx
xor ecx, ecx xor ecx, ecx
; We want to check if entire struct is zeroed out, if so, it is not an active NSID,
; otherwise it is
.inner_loop: .inner_loop:
mov eax, dword [edi + ecx * 4] mov eax, dword [edi + ecx * 4]
test eax, eax test eax, eax