Helper function returns pointer in esi instead of eax
This commit is contained in:
1 parent
30c3ba690c
commit
057fef4115
2 files changed
+10
-17
No files matched your search
@@ -12,9 +12,7 @@ VEN_STRIDE = 8
|
||||
; Returns pointer to the device id stored in data
|
||||
if used PCI_find_dev
|
||||
proc PCI_find_dev stdcall ven_id, dev_id
|
||||
xor eax, eax
|
||||
|
||||
push esi
|
||||
xor esi, esi
|
||||
|
||||
mov esi, ven1_array
|
||||
cmp [ven_id], VirtVendorID1
|
||||
@@ -33,24 +31,22 @@ proc PCI_find_dev stdcall ven_id, dev_id
|
||||
test edx, edx
|
||||
jz .not_found ;end of array
|
||||
|
||||
mov eax, esi
|
||||
add esi, VEN_STRIDE
|
||||
|
||||
cmp edx, [dev_id]
|
||||
jnz .loop
|
||||
jz .found
|
||||
|
||||
;found device
|
||||
add esi, VEN_STRIDE
|
||||
jmp .loop
|
||||
|
||||
.found:
|
||||
|
||||
pop edx
|
||||
pop esi
|
||||
ret
|
||||
|
||||
.not_found:
|
||||
|
||||
xor eax, eax
|
||||
pop edx
|
||||
@@:
|
||||
pop esi
|
||||
xor esi, esi
|
||||
ret
|
||||
endp
|
||||
end if
|
||||
|
||||
@@ -65,17 +65,14 @@ proc detect
|
||||
movzx ecx, cx
|
||||
movzx edx, dx
|
||||
|
||||
push eax
|
||||
|
||||
stdcall PCI_find_dev, edx, ecx
|
||||
test eax, eax
|
||||
test esi, esi
|
||||
jz .notVirt
|
||||
|
||||
add eax, 4
|
||||
DEBUGF 1, "I: %s %x:%x -> %s\n", esi, dx, cx, [eax]
|
||||
add esi, 4
|
||||
DEBUGF 1, "I: VirtIO Driver %x:%x -> %s\n", dx, cx, [esi]
|
||||
|
||||
.notVirt:
|
||||
pop eax
|
||||
jmp .next_dev
|
||||
|
||||
.finish:
|
||||
|
||||
Reference in new issue
Block a user