forked from KolibriOS/kolibrios
drivers related modification
git-svn-id: svn://kolibrios.org@377 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
6cf25c8bd8
commit
02bcaaab53
@ -241,36 +241,33 @@ proc srv_handler stdcall, ioctl:dword
|
||||
ret
|
||||
endp
|
||||
|
||||
; param
|
||||
; ebx= io_control
|
||||
;
|
||||
; retval
|
||||
; eax= error code
|
||||
|
||||
align 4
|
||||
proc srv_handlerEx stdcall, ioctl:dword
|
||||
mov esi, [ioctl]
|
||||
test esi, esi
|
||||
jz .err
|
||||
add esi, new_app_base
|
||||
srv_handlerEx:
|
||||
test ebx, ebx
|
||||
jz .fail
|
||||
add ebx, new_app_base
|
||||
|
||||
mov edi, [esi+handle]
|
||||
cmp [edi+SRV.magic], ' SRV'
|
||||
mov eax, [ebx+handle]
|
||||
cmp [eax+SRV.magic], ' SRV'
|
||||
jne .fail
|
||||
|
||||
cmp [edi+SRV.size], SRV_SIZE
|
||||
cmp [eax+SRV.size], SRV_SIZE
|
||||
jne .fail
|
||||
|
||||
add [esi+input], new_app_base
|
||||
add [esi+output], new_app_base
|
||||
add [ebx+input], new_app_base
|
||||
add [ebx+output], new_app_base
|
||||
|
||||
stdcall [edi+SRV.srv_proc], esi
|
||||
stdcall [eax+SRV.srv_proc], ebx
|
||||
ret
|
||||
.fail:
|
||||
xor eax, eax
|
||||
not eax
|
||||
mov [esi+output], eax
|
||||
mov [esi+out_size], 4
|
||||
or eax, -1
|
||||
ret
|
||||
.err:
|
||||
xor eax, eax
|
||||
not eax
|
||||
ret
|
||||
endp
|
||||
|
||||
restore handle
|
||||
restore io_code
|
||||
|
@ -39,6 +39,7 @@ iglobal
|
||||
szRaiseEvent db 'RaiseEvent',0
|
||||
szWaitEvent db 'WaitEvent',0
|
||||
szDestroyEvent db 'DestroyEvent',0
|
||||
szClearEvent db 'ClearEvent',0
|
||||
|
||||
szLoadCursor db 'LoadCursor',0
|
||||
szSetHwCursor db 'SetHwCursor',0
|
||||
@ -90,6 +91,7 @@ kernel_export:
|
||||
dd szRaiseEvent , raise_event
|
||||
dd szWaitEvent , wait_event
|
||||
dd szDestroyEvent , destroy_event
|
||||
dd szClearEvent , clear_event
|
||||
|
||||
dd szLoadCursor , load_cursor
|
||||
dd szSetHwCursor , set_hw_cursor
|
||||
|
@ -628,8 +628,8 @@ term9:
|
||||
|
||||
mov [fpu_owner],1
|
||||
mov eax, [256+PROC_BASE+APPDATA.fpu_state]
|
||||
clts
|
||||
bt [cpu_caps], CAPS_SSE
|
||||
clts
|
||||
jnc .no_SSE
|
||||
fxrstor [eax]
|
||||
jmp @F
|
||||
|
@ -101,6 +101,9 @@ end if
|
||||
if used DestroyEvent
|
||||
extrn DestroyEvent
|
||||
end if
|
||||
if used ClearEvent
|
||||
extrn ClearEvent
|
||||
end if
|
||||
|
||||
if used LoadCursor
|
||||
extrn LoadCursor
|
||||
|
@ -219,12 +219,12 @@ proc get_event_ex stdcall, p_ev:dword, timeout:dword
|
||||
.wait:
|
||||
mov edx,[CURRENT_TASK]
|
||||
shl edx,8
|
||||
cmp [PROC_BASE+edx+APPDATA.ev_count], 0
|
||||
je .switch
|
||||
; cmp [PROC_BASE+edx+APPDATA.ev_count], 0
|
||||
; je .switch
|
||||
|
||||
add edx, PROC_BASE+APP_EV_OFFSET
|
||||
|
||||
mov eax, [edx+EVENT.fd]
|
||||
mov eax, [edx+APPOBJ.fd]
|
||||
cmp eax, edx
|
||||
je .switch
|
||||
|
||||
@ -235,8 +235,7 @@ proc get_event_ex stdcall, p_ev:dword, timeout:dword
|
||||
rep movsd
|
||||
|
||||
and dword [edi-24], 0xFF00FFFF ;clear priority field
|
||||
;
|
||||
|
||||
;
|
||||
test [eax+EVENT.state], MANUAL_RESET
|
||||
jnz .done
|
||||
|
||||
@ -246,9 +245,13 @@ proc get_event_ex stdcall, p_ev:dword, timeout:dword
|
||||
mov ecx, [eax+APPOBJ.bk] ;and clear events flag
|
||||
mov [ebx+APPOBJ.bk], ecx ;if no active events
|
||||
mov [ecx+APPOBJ.fd], ebx
|
||||
|
||||
and [eax+EVENT.state], not (EVENT_SIGNALED+EVENT_WATCHED)
|
||||
|
||||
dec [edx+APPDATA.ev_count-APP_EV_OFFSET]
|
||||
jnz @F
|
||||
and [edx+APPDATA.event_mask-APP_EV_OFFSET], not EVENT_EXTENDED
|
||||
@@:
|
||||
popfd
|
||||
|
||||
test [eax+EVENT.state], MANUAL_DESTROY
|
||||
@ -258,11 +261,11 @@ proc get_event_ex stdcall, p_ev:dword, timeout:dword
|
||||
|
||||
pushfd
|
||||
cli
|
||||
mov edx, [ecx+APPOBJ.fd] ;insert event into
|
||||
mov [eax+APPOBJ.fd], edx ;objects list
|
||||
mov [eax+APPOBJ.bk], ecx
|
||||
mov [ecx+APPOBJ.fd], eax
|
||||
mov [edx+APPOBJ.bk], eax
|
||||
mov ebx, [edx+APPOBJ.fd] ;insert event into
|
||||
mov [eax+APPOBJ.fd], ebx ;objects list
|
||||
mov [eax+APPOBJ.bk], edx
|
||||
mov [edx+APPOBJ.fd], eax
|
||||
mov [ebx+APPOBJ.bk], eax
|
||||
popfd
|
||||
.done:
|
||||
ret
|
||||
@ -347,6 +350,7 @@ restore .event
|
||||
; eax= event
|
||||
; ebx= id
|
||||
; ecx= flags
|
||||
; edx= event data
|
||||
|
||||
raise_event:
|
||||
.event equ esp
|
||||
@ -362,7 +366,18 @@ raise_event:
|
||||
test eax, eax
|
||||
jz .fail
|
||||
|
||||
mov esi, edx
|
||||
test esi, esi
|
||||
mov edx, [.event]
|
||||
jz @F
|
||||
|
||||
push ecx
|
||||
lea edi, [edx+EVENT.code]
|
||||
mov ecx, 6
|
||||
cld
|
||||
rep movsd
|
||||
pop ecx
|
||||
@@:
|
||||
test [edx+EVENT.state], EVENT_SIGNALED
|
||||
jnz .done
|
||||
|
||||
@ -397,6 +412,54 @@ raise_event:
|
||||
ret
|
||||
restore .event
|
||||
|
||||
; param
|
||||
; eax= event
|
||||
; ebx= id
|
||||
align 4
|
||||
clear_event:
|
||||
.event equ esp
|
||||
push eax
|
||||
|
||||
cmp [eax+APPOBJ.magic], 'EVNT'
|
||||
jne .fail
|
||||
cmp [eax+EVENT.id], ebx
|
||||
jne .fail
|
||||
|
||||
mov eax, [eax+APPOBJ.pid]
|
||||
call pid_to_slot
|
||||
test eax, eax
|
||||
jz .fail
|
||||
|
||||
shl eax, 8
|
||||
add eax, PROC_BASE+APP_EV_OFFSET
|
||||
mov edx, [.event]
|
||||
pushfd
|
||||
cli ;remove event from events
|
||||
mov ebx, [edx+APPOBJ.fd] ;list (reset event)
|
||||
mov ecx, [edx+APPOBJ.bk] ;and clear events flag
|
||||
mov [ebx+APPOBJ.bk], ecx ;if no active events
|
||||
mov [ecx+APPOBJ.fd], ebx
|
||||
|
||||
and [edx+EVENT.state], not (EVENT_SIGNALED+EVENT_WATCHED)
|
||||
|
||||
dec [eax+APPDATA.ev_count-APP_EV_OFFSET]
|
||||
jnz @F
|
||||
and [eax+APPDATA.event_mask-APP_EV_OFFSET], not EVENT_EXTENDED
|
||||
@@:
|
||||
add eax, (APP_OBJ_OFFSET-APP_EV_OFFSET)
|
||||
|
||||
mov ecx, [eax+APPOBJ.fd] ;insert event into
|
||||
mov [edx+APPOBJ.fd], ecx ;objects list
|
||||
mov [edx+APPOBJ.bk], eax
|
||||
mov [eax+APPOBJ.fd], edx
|
||||
mov [ecx+APPOBJ.bk], edx
|
||||
popfd
|
||||
.fail:
|
||||
.done:
|
||||
add esp, 4
|
||||
ret
|
||||
restore .event
|
||||
|
||||
sys_getevent:
|
||||
|
||||
call get_event_for_app
|
||||
|
Loading…
Reference in New Issue
Block a user