Subversion Repositories Kolibri OS

Rev

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

Rev 3767 Rev 5070
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2013. 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
 
-
 
8
format PE DLL native 0.05
Line 8... Line 9...
8
format MS COFF
9
entry START
Line 9... Line 10...
9
 
10
 
10
DEBUG           = 1
11
        DEBUG = 1
11
 
12
 
12
include 'proc32.inc'
-
 
-
 
13
section '.flat' code readable writable executable
-
 
14
include '../proc32.inc'
Line 13... Line 15...
13
include 'imports.inc'
15
include '../struct.inc'
14
include '../struct.inc'
16
include '../macros.inc'
15
 
17
include '../peimport.inc'
16
 
18
 
Line 143... Line 145...
143
 
145
 
Line 144... Line 146...
144
CTRL_RDC_R3010           =  0x3010
146
CTRL_RDC_R3010           =  0x3010
Line 145... Line -...
145
 
-
 
146
CTRL_VMWARE_UNK1         =  0x1977
-
 
147
 
-
 
148
API_VERSION             = 0x01000100
-
 
149
 
-
 
150
public START
-
 
151
public service_proc
147
 
152
public version
148
CTRL_VMWARE_UNK1         =  0x1977
153
 
149
 
154
struct  SRV
150
struct  SRV
155
        srv_name        rb 16    ;ASCIIZ string
151
        srv_name        rb 16    ;ASCIIZ string
Line 162... Line 158...
162
        srv_proc        dd ?     ;+0x28 ;user mode service handler
158
        srv_proc        dd ?     ;+0x28 ;user mode service handler
163
        srv_proc_ex     dd ?     ;+0x2C ;kernel mode service handler
159
        srv_proc_ex     dd ?     ;+0x2C ;kernel mode service handler
164
ends
160
ends
Line 165... Line 161...
165
 
161
 
Line 166... Line -...
166
 
-
 
167
section '.flat' code readable align 16
-
 
168
 
-
 
169
proc START stdcall, state:dword
162
 
170
 
163
proc START c, state:dword, cmdline:dword
Line 171... Line 164...
171
        mov     eax, [srv_entry]
164
 
172
        cmp     [state], 1
165
        cmp     [state], 1
173
        jne     .stop
166
        jne     .stop
174
 
167
 
Line 175... Line 168...
175
     if DEBUG
168
     if DEBUG
176
        mov     esi, msgInit
169
        mov     esi, msgInit
177
        call    SysMsgBoardStr
170
        invoke  SysMsgBoardStr
Line 189... Line 182...
189
.done:
182
.done:
190
        xor     eax, eax
183
        xor     eax, eax
191
        ret
184
        ret
192
endp
185
endp
Line 193... Line -...
193
 
-
 
194
align 4
186
 
Line 195... Line 187...
195
proc service_proc stdcall, ioctl:dword
187
proc service_proc stdcall, ioctl:dword
196
 
188
 
197
        or      eax, -1
189
        or      eax, -1
Line 198... Line -...
198
        ret
-
 
199
endp
190
        ret
Line 200... Line 191...
200
 
191
endp
201
align 4
192
 
202
proc detect_controller
193
proc detect_controller
Line 208... Line 199...
208
           endl
199
endl
Line 209... Line 200...
209
 
200
 
210
        xor     eax, eax
201
        xor     eax, eax
211
        mov     [bus], eax
202
        mov     [bus], eax
212
        inc     eax
203
        inc     eax
213
        call    PciApi
204
        invoke  PciApi
214
        cmp     eax, -1
205
        cmp     eax, -1
Line 215... Line 206...
215
        je      .err
206
        je      .err
Line 216... Line 207...
216
 
207
 
217
        mov     [last_bus], eax
208
        mov     [last_bus], eax
218
 
209
 
219
  .next_bus:
210
  .next_bus:
220
        and     [devfn], 0
211
        and     [devfn], 0
221
  .next_dev:
212
  .next_dev:
222
        stdcall PciRead32, [bus], [devfn], dword 0
213
        invoke  PciRead32, [bus], [devfn], dword 0
223
        test    eax, eax
214
        test    eax, eax
Line 248... Line 239...
248
        ret
239
        ret
249
  .found:
240
  .found:
Line 250... Line 241...
250
 
241
 
251
     if DEBUG
242
     if DEBUG
252
        mov     esi, msgLoading
243
        mov     esi, msgLoading
Line 253... Line 244...
253
        call    SysMsgBoardStr
244
        invoke  SysMsgBoardStr
254
 
245
 
Line 255... Line 246...
255
        mov     esi, dword[edi+4]
246
        mov     esi, dword[edi+4]
256
        call    SysMsgBoardStr
247
        invoke  SysMsgBoardStr
257
 
248
 
Line 258... Line 249...
258
        mov     esi, msgNewline
249
        mov     esi, msgNewline
259
        call    SysMsgBoardStr
250
        invoke  SysMsgBoardStr
260
     end if
251
     end if
Line 261... Line 252...
261
 
252
 
262
        stdcall GetService, dword[edi+4]
253
        invoke  GetService, dword[edi+4]
263
        test    eax, eax
254
        test    eax, eax
Line 264... Line 255...
264
        jz      .err
255
        jz      .err
265
 
256
 
266
        mov     edx, [eax+SRV.entry]
257
        mov     edx, [eax+SRV.entry]
267
        mov     [srv_entry], edx
258
        mov     [srv_entry], edx
268
        ret
259
        ret
Line 269... Line 260...
269
 
260
 
270
  .err:
261
  .err:
Line 400... Line 391...
400
                dd (CTRL_VMWARE_UNK1  shl 16)+VID_VMWARE, intelhda
391
                dd (CTRL_VMWARE_UNK1  shl 16)+VID_VMWARE, intelhda
Line 401... Line 392...
401
 
392
 
Line 402... Line -...
402
                dd 0    ;terminator
-
 
403
 
-
 
404
 
393
                dd 0    ; terminator
Line 405... Line 394...
405
version         dd (5 shl 16) or (API_VERSION and 0xFFFF)
394
 
406
 
395
 
407
srv_entry       dd 0
396
srv_entry       dd 0
Line 417... Line 406...
417
msgInit         db 'Detecting hardware...',13,10,0
406
msgInit         db 'Detecting hardware...',13,10,0
418
msgFail         db 'No compatible soundcard found!',13,10,0
407
msgFail         db 'No compatible soundcard found!',13,10,0
419
msgLoading      db 'Loading ',0
408
msgLoading      db 'Loading ',0
420
msgNewline      db 13,10,0
409
msgNewline      db 13,10,0
Line 421... Line 410...
421
 
410
 
-
 
411
align 4
422
 
412
data fixups
423
section '.data' data readable writable align 16
413
end data