Subversion Repositories Kolibri OS

Rev

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

Rev 4467 Rev 4470
Line 346... Line 346...
346
 
346
 
347
align 4
347
align 4
Line 348... Line 348...
348
proc service_proc stdcall, ioctl:dword
348
proc service_proc stdcall, ioctl:dword
349
 
349
 
Line 350... Line 350...
350
        mov     edx, [ioctl]
350
        mov     edx, [ioctl]
Line 351... Line 351...
351
        mov     eax, [IOCTL.io_code]
351
        mov     eax, [edx + IOCTL.io_code]
352
 
352
 
Line 353... Line 353...
353
;------------------------------------------------------
353
;------------------------------------------------------
354
 
354
 
355
        cmp     eax, 0 ;SRV_GETVERSION
355
        cmp     eax, 0 ;SRV_GETVERSION
356
        jne     @F
356
        jne     @F
Line 357... Line 357...
357
 
357
 
358
        cmp     [IOCTL.out_size], 4
358
        cmp     [edx + IOCTL.out_size], 4
Line 359... Line 359...
359
        jb      .fail
359
        jb      .fail
360
        mov     eax, [IOCTL.output]
360
        mov     eax, [edx + IOCTL.output]
361
        mov     [eax], dword API_VERSION
361
        mov     [eax], dword API_VERSION
362
 
362
 
Line 363... Line 363...
363
        xor     eax, eax
363
        xor     eax, eax
364
        ret
364
        ret
Line 365... Line 365...
365
 
365
 
366
;------------------------------------------------------
366
;------------------------------------------------------
367
  @@:
367
  @@:
Line 368... Line 368...
368
        cmp     eax, 1 ;SRV_HOOK
368
        cmp     eax, 1 ;SRV_HOOK
Line 369... Line 369...
369
        jne     .fail
369
        jne     .fail
370
 
370
 
371
        cmp     [IOCTL.inp_size], 3                     ; Data input must be at least 3 bytes
371
        cmp     [edx + IOCTL.inp_size], 3                     ; Data input must be at least 3 bytes
372
        jb      .fail
372
        jb      .fail
Line 373... Line 373...
373
 
373
 
374
        mov     eax, [IOCTL.input]
374
        mov     eax, [edx + IOCTL.input]
375
        cmp     byte [eax], 1                           ; 1 means device number and bus number (pci) are given
375
        cmp     byte [eax], 1                           ; 1 means device number and bus number (pci) are given
376
        jne     .fail                                   ; other types arent supported for this card yet
376
        jne     .fail                                   ; other types arent supported for this card yet
377
 
377
 
378
; check if the device is already listed
378
; check if the device is already listed
Line 414... Line 414...
414
        mov     [device.unload], unload
414
        mov     [device.unload], unload
415
        mov     [device.name], my_service
415
        mov     [device.name], my_service
Line 416... Line 416...
416
 
416
 
Line 417... Line 417...
417
; save the pci bus and device numbers
417
; save the pci bus and device numbers
418
 
418
 
419
        mov     eax, [IOCTL.input]
419
        mov     eax, [edx + IOCTL.input]
420
        movzx   ecx, byte[eax+1]
420
        movzx   ecx, byte[eax+1]
421
        mov     [device.pci_bus], ecx
421
        mov     [device.pci_bus], ecx