Subversion Repositories Kolibri OS

Rev

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

Rev 4467 Rev 4470
Line 401... Line 401...
401
 
401
 
402
align 4
402
align 4
Line 403... Line 403...
403
proc service_proc stdcall, ioctl:dword
403
proc service_proc stdcall, ioctl:dword
404
 
404
 
Line 405... Line 405...
405
        mov     edx, [ioctl]
405
        mov     edx, [ioctl]
Line 406... Line 406...
406
        mov     eax, [IOCTL.io_code]
406
        mov     eax, [edx + IOCTL.io_code]
407
 
407
 
Line 408... Line 408...
408
;------------------------------------------------------
408
;------------------------------------------------------
409
 
409
 
410
        cmp     eax, 0 ;SRV_GETVERSION
410
        cmp     eax, 0 ;SRV_GETVERSION
411
        jne     @F
411
        jne     @F
Line 412... Line 412...
412
 
412
 
413
        cmp     [IOCTL.out_size], 4
413
        cmp     [edx + IOCTL.out_size], 4
Line 414... Line 414...
414
        jb      .fail
414
        jb      .fail
415
        mov     eax, [IOCTL.output]
415
        mov     eax, [edx + IOCTL.output]
416
        mov     [eax], dword API_VERSION
416
        mov     [eax], dword API_VERSION
417
 
417
 
Line 418... Line 418...
418
        xor     eax, eax
418
        xor     eax, eax
419
        ret
419
        ret
Line 420... Line 420...
420
 
420
 
421
;------------------------------------------------------
421
;------------------------------------------------------
422
  @@:
422
  @@:
Line 423... Line 423...
423
        cmp     eax, 1 ;SRV_HOOK
423
        cmp     eax, 1 ;SRV_HOOK
Line 424... Line 424...
424
        jne     .fail
424
        jne     .fail
425
 
425
 
426
        cmp     [IOCTL.inp_size], 3               ; Data input must be at least 3 bytes
426
        cmp     [edx + IOCTL.inp_size], 3               ; Data input must be at least 3 bytes
Line 427... Line 427...
427
        jb      .fail
427
        jb      .fail
428
 
428
 
429
        mov     eax, [IOCTL.input]
429
        mov     eax, [edx + IOCTL.input]
430
        cmp     byte [eax], 1                           ; 1 means device number and bus number (pci) are given
430
        cmp     byte [eax], 1                           ; 1 means device number and bus number (pci) are given
431
        jne     .fail                                   ; other types of this hardware dont exist
431
        jne     .fail                                   ; other types of this hardware dont exist
432
 
432
 
433
; check if the device is already listed
433
; check if the device is already listed
Line 454... Line 454...
454
        mov     ecx, [BOOMERANG_DEVICES]
454
        mov     ecx, [BOOMERANG_DEVICES]
455
        test    ecx, ecx
455
        test    ecx, ecx
456
        jz      .firstdevice
456
        jz      .firstdevice
Line 457... Line 457...
457
 
457
 
458
        mov     esi, BOOMERANG_LIST
458
        mov     esi, BOOMERANG_LIST
459
        mov     eax, [IOCTL.input]                      ; get the pci bus and device numbers
459
        mov     eax, [edx + IOCTL.input]                ; get the pci bus and device numbers
460
        mov     ax , [eax+1]                            ;
460
        mov     ax, [eax+1]                             ;
461
  .nextdevice2:
461
  .nextdevice2:
462
        mov     ebx, [esi]
462
        mov     ebx, [esi]
463
        cmp     al, byte[device.pci_bus]
463
        cmp     al, byte[device.pci_bus]
Line 485... Line 485...
485
        mov     [device.unload], null_op
485
        mov     [device.unload], null_op
486
        mov     [device.name], my_service
486
        mov     [device.name], my_service
Line 487... Line 487...
487
 
487
 
Line 488... Line 488...
488
; save the pci bus and device numbers
488
; save the pci bus and device numbers
489
 
489
 
490
        mov     eax, [IOCTL.input]
490
        mov     eax, [edx + IOCTL.input]
491
        movzx   ecx, byte[eax+1]
491
        movzx   ecx, byte[eax+1]
492
        mov     [device.pci_bus], ecx
492
        mov     [device.pci_bus], ecx