165,7 → 165,10 |
|
call pci_make_config_cmd |
mov ebx, eax |
; get current state |
mov dx, 0xcf8 |
in eax, dx |
push eax |
; set up addressing to config data |
mov eax, ebx |
and al, 0xfc; make address dword-aligned |
191,7 → 194,14 |
jmp pci_fin_read1 |
pci_read_dword1: |
in eax, dx |
jmp pci_fin_read1 |
pci_fin_read1: |
; restore configuration control |
xchg eax, [esp] |
mov dx, 0xcf8 |
out dx, eax |
|
pop eax |
pop esi ebx |
ret |
pci_read_reg_2: |
202,8 → 212,15 |
mov esi, eax ; save register size into ESI |
and esi, 3 |
|
mov dx, 0xcfa |
push eax |
;store current state of config space |
mov dx, 0xcf8 |
in al, dx |
mov ah, al |
mov dl, 0xfa |
in al, dx |
|
xchg eax, [esp] |
; out 0xcfa,bus |
mov al, ah |
out dx, al |
232,8 → 249,18 |
jmp pci_fin_read2 |
pci_read_dword2: |
in eax, dx |
; jmp pci_fin_read2 |
pci_fin_read2: |
|
; restore configuration space |
xchg eax, [esp] |
mov dx, 0xcfa |
out dx, al |
mov dl, 0xf8 |
mov al, ah |
out dx, al |
|
pop eax |
pop esi ebx |
ret |
|
269,7 → 296,10 |
|
call pci_make_config_cmd |
mov ebx, eax |
; get current state into ecx |
mov dx, 0xcf8 |
in eax, dx |
push eax |
; set up addressing to config data |
mov eax, ebx |
and al, 0xfc; make address dword-aligned |
296,8 → 326,14 |
jmp pci_fin_write1 |
pci_write_dword1: |
out dx, eax |
jmp pci_fin_write1 |
pci_fin_write1: |
|
; restore configuration control |
pop eax |
mov dl, 0xf8 |
out dx, eax |
|
xor eax, eax |
pop ebx esi |
|
311,7 → 347,14 |
mov esi, eax ; save register size into ESI |
and esi, 3 |
|
mov dx, 0xcfa |
push eax |
;store current state of config space |
mov dx, 0xcf8 |
in al, dx |
mov ah, al |
mov dl, 0xfa |
in al, dx |
xchg eax, [esp] |
; out 0xcfa,bus |
mov al, ah |
out dx, al |
342,7 → 385,15 |
jmp pci_fin_write2 |
pci_write_dword2: |
out dx, eax |
jmp pci_fin_write2 |
pci_fin_write2: |
; restore configuration space |
pop eax |
mov dx, 0xcfa |
out dx, al |
mov dl, 0xf8 |
mov al, ah |
out dx, al |
|
xor eax, eax |
pop ebx esi |