Subversion Repositories Kolibri OS

Rev

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

Rev 732 Rev 740
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2008. 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 8... Line 8...
8
$Revision: 732 $
8
$Revision: 740 $
9
 
9
 
Line 181... Line 181...
181
	   jmp .wait
181
	   jmp .wait
182
endp
182
endp
Line 183... Line 183...
183
 
183
 
184
align 4
184
align 4
-
 
185
proc pci_read32 stdcall, bus:dword, devfn:dword, reg:dword
185
proc pci_read32 stdcall, bus:dword, devfn:dword, reg:dword
186
           push ebx
186
	   xor eax, eax
187
	   xor eax, eax
187
	   xor ebx, ebx
188
	   xor ebx, ebx
188
	   mov ah, byte [bus]
189
	   mov ah, byte [bus]
189
	   mov al, 6
190
	   mov al, 6
190
	   mov bh, byte [devfn]
191
	   mov bh, byte [devfn]
191
	   mov bl, byte [reg]
192
	   mov bl, byte [reg]
-
 
193
	   call pci_read_reg
192
	   call pci_read_reg
194
           pop ebx
193
	   ret
195
	   ret
Line 194... Line 196...
194
endp
196
endp
195
 
197
 
Line 347... Line 349...
347
	   mov eax, edx
349
	   mov eax, edx
348
	   ret
350
	   ret
349
endp
351
endp
Line 350... Line 352...
350
 
352
 
351
align 4
-
 
352
reg_service:
-
 
353
.sz_name equ esp+4
-
 
354
.handler equ esp+8
353
align 4
355
	   mov eax, [.sz_name]
-
 
356
	   test eax, eax
-
 
Line 357... Line -...
357
	   jz .fail
-
 
358
 
354
proc reg_service stdcall, name:dword, handler:dword
359
	   mov ebx, [.handler]
-
 
Line -... Line 355...
-
 
355
 
-
 
356
           xor eax, eax
-
 
357
 
-
 
358
           cmp [name], eax
-
 
359
           je .fail
-
 
360
 
-
 
361
           cmp [handler], eax
360
	   test ebx, ebx
362
           je .fail
361
	   jz .fail
363
 
-
 
364
           push ebx
362
 
365
	   mov eax, SRV_SIZE
363
	   mov eax, SRV_SIZE
366
	   call malloc		 ;call alloc_service
Line -... Line 367...
-
 
367
           pop ebx
-
 
368
	   test eax, eax
-
 
369
	   jz .fail
364
	   call malloc		 ;call alloc_service
370
 
365
	   test eax, eax
371
           push ebx
366
	   jz .fail
372
           push esi
367
 
373
           push edi
-
 
374
	   mov edi, eax
-
 
375
           mov esi, [name]
Line 368... Line 376...
368
	   mov edi, eax
376
	   mov ecx, 16/4
369
	   mov esi, [.sz_name]
377
	   rep movsd
Line 370... Line 378...
370
	   mov ecx, 16/4
378
           pop edi
Line 378... Line 386...
378
	   mov [eax+SRV.fd], edx
386
	   mov [eax+SRV.fd], edx
379
	   mov [eax+SRV.bk], ebx
387
	   mov [eax+SRV.bk], ebx
380
	   mov [ebx+SRV.fd], eax
388
	   mov [ebx+SRV.fd], eax
381
	   mov [edx+SRV.bk], eax
389
	   mov [edx+SRV.bk], eax
Line 382... Line 390...
382
 
390
 
383
	   mov ecx, [.handler]
391
           mov ecx, [handler]
-
 
392
	   mov [eax+SRV.srv_proc], ecx
384
	   mov [eax+SRV.srv_proc], ecx
393
           pop ebx
385
	   ret 8
394
           ret
386
.fail:
395
.fail:
387
	   xor eax, eax
396
	   xor eax, eax
-
 
397
           ret
Line 388... Line 398...
388
	   ret 8
398
endp
389
 
399
 
Line 390... Line 400...
390
align 4
400
align 4