Subversion Repositories Kolibri OS

Rev

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

Rev 444 Rev 462
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
;driver sceletone
8
;driver sceletone
Line -... Line 9...
-
 
9
 
-
 
10
format MS COFF
9
 
11
 
10
format MS COFF
12
API_VERSION     equ 0  ;debug
Line 11... Line 13...
11
 
13
 
12
include 'proc32.inc'
14
include 'proc32.inc'
Line 37... Line 39...
37
 
39
 
38
DRV_ENTRY  equ 1
40
DRV_ENTRY    equ 1
39
DRV_EXIT   equ -1
41
DRV_EXIT     equ -1
Line -... Line 42...
-
 
42
STRIDE       equ 4      ;size of row in devices table
-
 
43
 
40
STRIDE     equ 4      ;size of row in devices table
44
SRV_GETVERSION  equ 0
Line 41... Line 45...
41
 
45
 
Line 42... Line 46...
42
section '.flat' code readable align 16
46
section '.flat' code readable align 16
Line 68... Line 72...
68
out_size   equ  IOCTL.out_size
72
out_size   equ  IOCTL.out_size
Line 69... Line 73...
69
 
73
 
70
align 4
74
align 4
Line 71... Line 75...
71
proc service_proc stdcall, ioctl:dword
75
proc service_proc stdcall, ioctl:dword
72
 
76
 
-
 
77
           mov ebx, [ioctl]
-
 
78
           mov eax, [ebx+io_code]
73
;           mov edi, [ioctl]
79
           cmp eax, SRV_GETVERSION
-
 
80
           jne @F
-
 
81
 
-
 
82
           mov eax, [ebx+output]
-
 
83
           cmp [ebx+out_size], 4
74
;           mov eax, [edi+io_code]
84
           jne .fail
75
 
85
           mov [eax], dword API_VERSION
-
 
86
           xor eax, eax
-
 
87
           ret
-
 
88
@@:
-
 
89
.fail:
76
	   xor eax, eax
90
           or eax, -1
Line 77... Line 91...
77
	   ret
91
           ret
78
endp
92
endp
79
 
93
 
Line 114... Line 128...
114
	   test ebx, ebx
128
           test ebx, ebx
115
	   jz .next
129
           jz .next
Line 116... Line 130...
116
 
130
 
117
	   cmp eax, ebx
131
           cmp eax, ebx
-
 
132
           je .found
118
	   je .found
133
 
119
           add edi, STRIDE
134
           add edi, STRIDE
120
           jmp @B
135
           jmp @B
121
 
136
.next:
122
.next:	   inc [devfn]
137
           inc [devfn]
123
	   cmp [devfn], 256
138
           cmp [devfn], 256
124
	   jb  .next_dev
139
           jb  .next_dev
125
	   mov eax, [bus]
140
           mov eax, [bus]
126
	   inc eax
141
           inc eax
Line 136... Line 151...
136
.err:
151
.err:
137
           xor eax, eax
152
           xor eax, eax
138
           ret
153
           ret
139
endp
154
endp
Line 140... Line -...
140
 
-
 
141
 
155
 
142
;DEVICE_ID equ  ; pci device id
156
DEVICE_ID    equ  1234;  pci device id
Line 143... Line 157...
143
;VENDOR_ID equ  ; device vendor id
157
VENDOR_ID    equ  5678;  device vendor id
Line 144... Line 158...
144
 
158
 
145
 
159
 
146
;all initialized data place here
160
;all initialized data place here
Line 147... Line 161...
147
 
161
 
Line 148... Line 162...
148
align 4
162
align 4
Line 149... Line 163...
149
devices dd (DEVICE_ID shl 16)+VENDOR_ID
163
devices      dd (DEVICE_ID shl 16)+VENDOR_ID
150
        dd 0    ;terminator
164
             dd 0    ;terminator