Subversion Repositories Kolibri OS

Rev

Rev 5565 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5565 Rev 5577
Line 19... Line 19...
19
;;                                                              ;;
19
;;                                                              ;;
20
;;  See file COPYING for details                                ;;
20
;;  See file COPYING for details                                ;;
21
;;                                                              ;;
21
;;                                                              ;;
22
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 23... Line 23...
23
 
23
 
Line 24... Line 24...
24
$Revision: 5565 $
24
$Revision: 5577 $
25
 
25
 
26
;***************************************************************************
26
;***************************************************************************
27
;   Function
27
;   Function
Line 163... Line 163...
163
        mov     esi, eax ; save register size into ESI
163
        mov     esi, eax ; save register size into ESI
164
        and     esi, 3
164
        and     esi, 3
Line 165... Line 165...
165
 
165
 
166
        call    pci_make_config_cmd
166
        call    pci_make_config_cmd
167
        mov     ebx, eax
-
 
168
                ; get current state
167
        mov     ebx, eax
169
        mov     dx, 0xcf8
168
        mov     dx, 0xcf8
170
        in      eax, dx
169
        in      eax, dx
171
        push    eax
170
        push    eax
172
                ; set up addressing to config data
171
                ; set up addressing to config data
Line 690... Line 689...
690
        call    malloc
689
        call    malloc
691
        pop     ecx
690
        pop     ecx
692
        test    eax, eax
691
        test    eax, eax
693
        jz      .nomemory
692
        jz      .nomemory
694
        mov     edi, eax
693
        mov     edi, eax
695
        mov     [edi+PCIDEV.vid_did], ecx
694
        mov     [edi+PCIDEV.vendor_device_id], ecx
696
        mov     edx, pcidev_list
695
        mov     edx, pcidev_list
697
        list_add_tail edi, edx
696
        list_add_tail edi, edx
698
        mov     eax, dword [.devfn]
697
        mov     eax, dword [.devfn]
699
        mov     word [edi+PCIDEV.devfn], ax
698
        mov     word [edi+PCIDEV.devfn], ax
700
        mov     bh, al
699
        mov     bh, al
Line 702... Line 701...
702
        mov     bl, PCI_CLASS_REVISION
701
        mov     bl, PCI_CLASS_REVISION
703
        call    pci_read_reg
702
        call    pci_read_reg
704
        shr     eax, 8                                ;FIXME use byte mask
703
        shr     eax, 8                                ;FIXME use byte mask
705
        mov     [edi+PCIDEV.class], eax
704
        mov     [edi+PCIDEV.class], eax
Line 706... Line 705...
706
 
705
 
707
        mov     ah, [.bus]
706
;        mov     ah, [.bus]
708
        mov     bh, byte [.devfn]
707
;        mov     bh, byte [.devfn]
709
        mov     al, 2
708
;        mov     al, 2
710
        mov     bl, PCI_SUBSYSTEM_VENDOR_ID
709
;        mov     bl, PCI_SUBSYSTEM_VENDOR_ID
711
        call    pci_read_reg
710
;        call    pci_read_reg
712
        mov     [edi+PCIDEV.svid_sdid], eax
711
;        mov     [edi+PCIDEV.svid_sdid], eax
713
 
712
 
714
        mov     ah, [.bus]
713
;        mov     ah, [.bus]
715
        mov     al, 0
714
;        mov     al, 0
716
        mov     bh, [.devfn]
715
;        mov     bh, [.devfn]
717
        mov     bl, PCI_IRQ_LINE
716
;        mov     bl, PCI_IRQ_LINE
718
        call    pci_read_reg
717
;        call    pci_read_reg
Line 719... Line 718...
719
        mov     [edi+PCIDEV.irq_line], al
718
;        mov     [edi+PCIDEV.irq_line], al
720
 
719
 
721
        test    byte [.devfn], 7
720
        test    byte [.devfn], 7
722
        jnz     .next_func
721
        jnz     .next_func
Line 737... Line 736...
737
.nomemory:
736
.nomemory:
738
        leave
737
        leave
739
        ret
738
        ret
740
endp
739
endp
Line -... Line 740...
-
 
740
 
-
 
741
; Export for drivers. Just returns the pointer to the pci-devices list.
-
 
742
proc get_pcidev_list
-
 
743
        mov     eax, pcidev_list
-
 
744
        ret
Line 741... Line 745...
741
 
745
endp
Line 742... Line 746...
742
 
746
 
743
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
747
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;