pcidev post-enumeration bug fixed

git-svn-id: svn://kolibrios.org@1386 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Artem Jerdev (art_zh) 2010-02-03 11:22:32 +00:00
parent ad16372cdb
commit 5d324bdafa

View File

@ -26,13 +26,13 @@
; Full device detection (like "ATI Radeon 9200") will increase app ; Full device detection (like "ATI Radeon 9200") will increase app
; size a lot and probably it is function of particular drivers ; size a lot and probably it is function of particular drivers
;---------------------------------------------------------------- ;----------------------------------------------------------------
;2.2: PCIDEV 31/12/2009 ;2.2: PCIDEV 03/01/2010
;Author: Artem Jerdev <art_zh@yahoo.com> ;Author: Artem Jerdev <art_zh@yahoo.com>
;Features: ;Features:
; fixed ; fixed
; * English in some comments ;) ; * English in some comments ;)
; added ; added
; * ! user-accessible PCI memory channels detection ; * ! user-accessible MMIO channels detection
; * ! ASCII-dump as PCI memory access demonstration ; * ! ASCII-dump as PCI memory access demonstration
; optimization ; optimization
; * (yet needed) ; * (yet needed)
@ -240,8 +240,16 @@ nomo: ;done drawing bars here
; Quantity of devices... ; Quantity of devices...
movzx ecx, byte [total] ; number to draw movzx ecx, byte [total] ; number to draw
mcall 47, 0x00020000,,150 * 65536 + 65, 0x224466 mcall 47, 0x00020000,,150 * 65536 + 65, 0x224466
mov ah, [MMIO_allowed]
or ah, ah
jz @f
mov ah, [MMIO_Bus] ; =255 if MMIO disabled / not found
and ah, 0x7f
inc ah
jo @f
call Try_MMIO call Try_MMIO
@@:
mcall 12, 2 ; end of draw mcall 12, 2 ; end of draw
ret ret
@ -312,32 +320,43 @@ nextDev:
jbe Start_Enum ; if not jump to keep searching jbe Start_Enum ; if not jump to keep searching
ret ret
no_ummio_allowed:
xor al,al
mov [MMIO_allowed],al ; re-enter the subroutine
;------------------------------------------------------------------ ;------------------------------------------------------------------
;* Print device info to screen ;* Print device info to screen
Print_New_Device: Print_New_Device:
xor esi, esi ; default text color xor esi, esi ; default text color
; by art_zh December 2009 mov cl, [MMIO_allowed]
mov ch, byte [V_Bus] or cl,cl
mov cl, byte [V_Dev] jz no_ummio_here
mov ch, byte [V_Bus]
mov cl, byte [V_Dev]
mcall 62, 11 ; detect uMMIO mcall 62, 11 ; detect uMMIO
cmp eax, -2 and ax,0x7fff
je no_ummio_here inc ax ; -1 returned?
mov esi, 0x990033 ; highlighted text color jo no_ummio_allowed
mov bh, byte [V_Bus] inc ax ; -2 returned?
mov bl, byte [V_Dev] jo no_ummio_here
mov byte [MMIO_Bus], bh inc ax ; -3 returned?
mov byte [MMIO_Dev], bl jo no_ummio_here
add bh,'0' mov esi, 0x990033 ; highlighted text color
mov [PCIWin + 129], bh ; uMMIO bus mov bh, byte [V_Bus]
mov al, bl mov bl, byte [V_Dev]
shr al, 1 mov byte [MMIO_Bus], bh
shr al, 1 mov byte [MMIO_Dev], bl
shr al, 1 add bh,'0'
add al,'0' mov [PCIWin + 129], bh ; uMMIO bus
mov [PCIWin + 131], al ; uMMIO device mov al, bl
and bl, 7 shr al, 1
add bl, '0' shr al, 1
mov [PCIWin + 133], bl ; uMMIO function shr al, 1
add al,'0'
mov [PCIWin + 131], al ; uMMIO device
and bl, 7
add bl, '0'
mov [PCIWin + 133], bl ; uMMIO function
no_ummio_here: no_ummio_here:
movzx ecx,word [PCI_Vendor] ; Pointer to number to be written movzx ecx,word [PCI_Vendor] ; Pointer to number to be written
@ -560,10 +579,10 @@ PCI_Interface db ?
PCI_IRQ db ? PCI_IRQ db ?
align 4 align 4
MMIO_Bus db ? MMIO_Bus db 255
MMIO_Dev db ? MMIO_Dev db 255
MMIO_BAR db 0 MMIO_BAR db 0
MMIO_Blk db 0 MMIO_allowed db 1
MMIO_Map rd 8 MMIO_Map rd 8
gr_pos dd ? gr_pos dd ?