Fix bug in PCI driver with not saved registers

In the PCI driver's device enumeration function, there was a mistake
where a register that is being used in that function wasn't preserved
as it should've been. It didn't cause any errors (at least yet), but
it's better to fix such stuff once found.
This commit is contained in:
Eric-Paul Ickhorn 2024-08-17 18:59:52 +02:00
parent 459936de7a
commit c249510163
Signed by: epickh
GPG Key ID: 1358818BAA38B104
2 changed files with 4 additions and 3 deletions

View File

@ -34,7 +34,7 @@ initialize_pci_driver:
push ebp push ebp
mov ebp, esp mov ebp, esp
push ebx push dword PCI_DEVICE_COUNT_OFFSET
push dword 2 push dword 2
push dword 0 push dword 0
push dword 0 push dword 0

View File

@ -190,11 +190,12 @@ pci_enumerate_bus:
mov [esi + (64 - 8)], ebx mov [esi + (64 - 8)], ebx
mov [esi + (64 - 12)], ecx mov [esi + (64 - 12)], ecx
mov [esi + (64 - 16)], edx
mov [esi + (64 - 20)], edi mov [esi + (64 - 20)], edi
; [esi]: Device-in-bus Index ; [esi]: Device-in-bus Index
; [esi + 4]: Number of existing devices ; [esi + 4]: Number of existing devices
; [esi + 8]: Bus number ; [esi + 8]: Bus number
; [esi + 12]: ; [esi + 12]: PCI driver area pointer
mov [esi], dword 0 mov [esi], dword 0
mov [esi + 4], dword 0 mov [esi + 4], dword 0
mov eax, [ebp - 8] mov eax, [ebp - 8]
@ -259,6 +260,7 @@ pci_enumerate_bus:
.epilog: .epilog:
mov ebx, [esi + (64 - 8)] mov ebx, [esi + (64 - 8)]
mov ecx, [esi + (64 - 12)] mov ecx, [esi + (64 - 12)]
mov edx, [esi + (64 - 16)]
mov edi, [esi + (64 - 20)] mov edi, [esi + (64 - 20)]
mov eax, [esi + 4] mov eax, [esi + 4]
@ -313,7 +315,6 @@ pci_enumerate:
cmp edx, [ebp - 8] cmp edx, [ebp - 8]
jae .epilog jae .epilog
.call_bus_enumerator: .call_bus_enumerator:
push ebp push ebp
mov ebp, esp mov ebp, esp