Subversion Repositories Kolibri OS

Rev

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

Rev 5170 Rev 5173
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 198... Line 198...
198
        last_bus dd ?
198
        last_bus dd ?
199
        bus      dd ?
199
        bus      dd ?
200
        devfn    dd ?
200
        devfn    dd ?
201
endl
201
endl
Line 202... Line -...
202
 
-
 
203
        xor     eax, eax
-
 
204
        mov     [bus], eax
-
 
205
        inc     eax
202
 
206
        invoke  PciApi
-
 
207
        cmp     eax, -1
-
 
208
        je      .no_pci
-
 
209
 
-
 
210
        mov     [last_bus], eax
-
 
211
 
-
 
212
  .next_bus:
-
 
213
        and     [devfn], 0
-
 
214
  .next_dev:
-
 
215
        invoke  PciRead32, [bus], [devfn], PCI_header.vendor_id
203
        invoke  GetPCIList
216
        test    eax, eax
-
 
217
        jz      .next
-
 
218
        cmp     eax, -1
-
 
Line -... Line 204...
-
 
204
        mov     edx, eax
-
 
205
 
219
        je      .next
206
  .loop:
220
 
207
        mov     ecx, [eax + PCIDEV.vendor_device_id]
221
        mov     edi, devices
208
        mov     edi, devices
222
  @@:
209
  @@:
223
        mov     ebx, [edi]
210
        mov     ebx, [edi]
Line 224... Line 211...
224
        test    ebx, ebx
211
        test    ebx, ebx
225
        jz      .next
212
        jz      .next
226
 
213
 
227
        cmp     eax, ebx
214
        cmp     ecx, ebx
Line 228... Line 215...
228
        je      .found
215
        je      .found
229
        add     edi, 8
-
 
230
        jmp     @B
-
 
231
 
-
 
232
  .next:
-
 
233
        test    [devfn], 7
-
 
234
        jnz     .next_fn
-
 
235
        invoke  PciRead8, [bus], [devfn], PCI_header.header_type
-
 
236
        test    al, al
-
 
237
        js      .next_fn
-
 
238
        or      [devfn], 7
-
 
239
 
-
 
240
  .next_fn:
216
        add     edi, 8
241
        inc     [devfn]
-
 
242
        cmp     [devfn], 256
217
        jmp     @b
243
        jb      .next_dev
-
 
244
        mov     eax, [bus]
218
 
Line 245... Line -...
245
        inc     eax
-
 
246
        mov     [bus], eax
219
  .next:
247
        cmp     eax, [last_bus]
220
        mov     eax, [eax + PCIDEV.fd]
248
        jna     .next_bus
221
        cmp     eax, edx
Line 249... Line 222...
249
 
222
        jne     .loop