Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 462 → Rev 461

/kernel/branches/flat_kernel/drivers/sceletone.asm
9,8 → 9,6
 
format MS COFF
 
API_VERSION equ 0 ;debug
 
include 'proc32.inc'
include 'imports.inc'
 
41,8 → 39,6
DRV_EXIT equ -1
STRIDE equ 4 ;size of row in devices table
 
SRV_GETVERSION equ 0
 
section '.flat' code readable align 16
 
proc START stdcall, state:dword
74,21 → 70,11
align 4
proc service_proc stdcall, ioctl:dword
 
mov ebx, [ioctl]
mov eax, [ebx+io_code]
cmp eax, SRV_GETVERSION
jne @F
; mov edi, [ioctl]
; mov eax, [edi+io_code]
 
mov eax, [ebx+output]
cmp [ebx+out_size], 4
jne .fail
mov [eax], dword API_VERSION
xor eax, eax
ret
@@:
.fail:
or eax, -1
ret
endp
 
restore handle
130,11 → 116,10
 
cmp eax, ebx
je .found
 
add edi, STRIDE
jmp @B
.next:
inc [devfn]
 
.next: inc [devfn]
cmp [devfn], 256
jb .next_dev
mov eax, [bus]
153,10 → 138,11
ret
endp
 
DEVICE_ID equ 1234; pci device id
VENDOR_ID equ 5678; device vendor id
 
;DEVICE_ID equ ; pci device id
;VENDOR_ID equ ; device vendor id
 
 
;all initialized data place here
 
align 4
163,7 → 149,7
devices dd (DEVICE_ID shl 16)+VENDOR_ID
dd 0 ;terminator
 
version dd (5 shl 16) or (API_VERSION and 0xFFFF)
version dd 0x00030003
 
my_service db 'MY_SERVICE',0 ;max 16 chars include zero