sound: call real driver, when kernel stop the service

git-svn-id: svn://kolibrios.org@3765 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2013-07-05 10:28:40 +00:00
parent ab74087413
commit 2660526423

View File

@ -149,10 +149,27 @@ public START
public service_proc public service_proc
public version public version
struct SRV
srv_name rb 16 ;ASCIIZ string
magic dd ? ;+0x10 ;'SRV '
size dd ? ;+0x14 ;size of structure SRV
fd dd ? ;+0x18 ;next SRV descriptor
bk dd ? ;+0x1C ;prev SRV descriptor
base dd ? ;+0x20 ;service base address
entry dd ? ;+0x24 ;service START function
srv_proc dd ? ;+0x28 ;user mode service handler
srv_proc_ex dd ? ;+0x2C ;kernel mode service handler
ends
section '.flat' code readable align 16 section '.flat' code readable align 16
proc START stdcall, state:dword proc START stdcall, state:dword
mov eax, [srv_entry]
test eax, eax
jnz .done
cmp [state], 1 cmp [state], 1
jne .stop jne .stop
@ -163,7 +180,9 @@ proc START stdcall, state:dword
call detect_controller call detect_controller
ret ret
.stop: .stop:
jmp eax
.done:
xor eax, eax xor eax, eax
ret ret
endp endp
@ -237,7 +256,11 @@ proc detect_controller
end if end if
stdcall GetService, dword[edi+4] stdcall GetService, dword[edi+4]
test eax, eax
jz .err
mov edx, [eax+SRV.entry]
mov [srv_entry], edx
ret ret
.err: .err:
@ -377,6 +400,8 @@ devices dd (CTRL_ICH shl 16)+VID_INTEL, intelac97
version dd (5 shl 16) or (API_VERSION and 0xFFFF) version dd (5 shl 16) or (API_VERSION and 0xFFFF)
srv_entry dd 0
intelac97 db 'INTELAC97', 0 intelac97 db 'INTELAC97', 0
vt823x db 'VT823X', 0 vt823x db 'VT823X', 0
sis db 'SIS', 0 sis db 'SIS', 0