add APPDATA.state for delete TASKDATA

git-svn-id: svn://kolibrios.org@9612 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Doczom 2022-01-10 22:29:14 +00:00
parent 278fc718e1
commit 2470cf023c
2 changed files with 92 additions and 76 deletions

View File

@ -201,3 +201,74 @@ startstopclk:
btc ax, 7 btc ax, 7
out dx, al out dx, al
ret ret
align 4
sys_clock:
cli
; Mikhail Lisovin xx Jan 2005
@@:
mov al, 10
out 0x70, al
in al, 0x71
test al, al
jns @f
mov esi, 1
call delay_ms
jmp @b
@@:
; end Lisovin's fix
xor al, al ; seconds
out 0x70, al
in al, 0x71
movzx ecx, al
mov al, 02 ; minutes
shl ecx, 16
out 0x70, al
in al, 0x71
movzx edx, al
mov al, 04 ; hours
shl edx, 8
out 0x70, al
in al, 0x71
add ecx, edx
movzx edx, al
add ecx, edx
sti
mov [esp + 32], ecx
ret
align 4
sys_date:
cli
@@:
mov al, 10
out 0x70, al
in al, 0x71
test al, al
jns @f
mov esi, 1
call delay_ms
jmp @b
@@:
mov ch, 0
mov al, 7 ; date
out 0x70, al
in al, 0x71
mov cl, al
mov al, 8 ; month
shl ecx, 16
out 0x70, al
in al, 0x71
mov ch, al
mov al, 9 ; year
out 0x70, al
in al, 0x71
mov cl, al
sti
mov [esp+32], ecx
ret

View File

@ -1182,6 +1182,7 @@ proc setup_os_slot
list_add_tail ebx, ecx list_add_tail ebx, ecx
mov [edx+APPDATA.wnd_number], dh mov [edx+APPDATA.wnd_number], dh
mov byte [edx+APPDATA.tid], dh ;?
mov eax, edx mov eax, edx
shr eax, 3 shr eax, 3
add eax, TASK_TABLE - (SLOT_BASE shr 3) add eax, TASK_TABLE - (SLOT_BASE shr 3)
@ -1926,8 +1927,10 @@ sys_end:
;-------------------------------------- ;--------------------------------------
; kill all sockets this process owns ; kill all sockets this process owns
pusha pusha
mov edx, [TASK_BASE] mov edx, [current_slot]
mov edx, [edx+TASKDATA.pid] mov edx, [edx+APPDATA.tid]
mov edx, [TASK_BASE] ; delete
mov edx, [edx+TASKDATA.pid] ;
call socket_process_end call socket_process_end
popa popa
;-------------------------------------- ;--------------------------------------
@ -1939,8 +1942,10 @@ sys_end:
stdcall user_free, eax stdcall user_free, eax
@@: @@:
mov eax, [TASK_BASE] mov eax, [current_slot]
mov [eax+TASKDATA.state], TSTATE_ZOMBIE mov [eax+APPDATA.state], TSTATE_ZOMBIE
mov eax, [TASK_BASE] ;
mov [eax+TASKDATA.state], TSTATE_ZOMBIE ; delete
call wakeup_osloop call wakeup_osloop
.waitterm: ; wait here for termination .waitterm: ; wait here for termination
@ -2708,80 +2713,9 @@ sys_cpuusage:
mov dword [esp+32], -1 mov dword [esp+32], -1
ret ret
align 4
sys_clock:
cli
; Mikhail Lisovin xx Jan 2005
@@:
mov al, 10
out 0x70, al
in al, 0x71
test al, al
jns @f
mov esi, 1
call delay_ms
jmp @b
@@:
; end Lisovin's fix
xor al, al ; seconds
out 0x70, al
in al, 0x71
movzx ecx, al
mov al, 02 ; minutes
shl ecx, 16
out 0x70, al
in al, 0x71
movzx edx, al
mov al, 04 ; hours
shl edx, 8
out 0x70, al
in al, 0x71
add ecx, edx
movzx edx, al
add ecx, edx
sti
mov [esp + 32], ecx
ret
align 4
sys_date:
cli
@@:
mov al, 10
out 0x70, al
in al, 0x71
test al, al
jns @f
mov esi, 1
call delay_ms
jmp @b
@@:
mov ch, 0
mov al, 7 ; date
out 0x70, al
in al, 0x71
mov cl, al
mov al, 8 ; month
shl ecx, 16
out 0x70, al
in al, 0x71
mov ch, al
mov al, 9 ; year
out 0x70, al
in al, 0x71
mov cl, al
sti
mov [esp+32], ecx
ret
; redraw status ; redraw status
align 4
sys_redrawstat: sys_redrawstat:
cmp ebx, 1 cmp ebx, 1
jne no_widgets_away jne no_widgets_away
@ -3142,6 +3076,7 @@ markz:
test eax, eax test eax, eax
jz @f jz @f
mov [edx+TASKDATA.state], TSTATE_ZOMBIE mov [edx+TASKDATA.state], TSTATE_ZOMBIE
;mov [edx+APPDATA.state], TSTATE_ZOMBIE
@@: @@:
add edx, 0x20 add edx, 0x20
loop markz loop markz
@ -3471,8 +3406,10 @@ delay_ms: ; delay in 1/1000 sec
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4 align 4
set_app_param: set_app_param:
mov edi, [current_slot]
mov edi, [TASK_BASE] mov edi, [TASK_BASE]
mov eax, ebx mov eax, ebx
;xchg eax, [edi + APPDATA.event_mask] ; set new event mask
xchg eax, [edi + TASKDATA.event_mask] ; set new event mask xchg eax, [edi + TASKDATA.event_mask] ; set new event mask
mov [esp+32], eax ; return old mask value mov [esp+32], eax ; return old mask value
ret ret
@ -3687,6 +3624,8 @@ no_unmask_io:
mov [RESERVED_PORTS], eax mov [RESERVED_PORTS], eax
shl eax, 4 shl eax, 4
add eax, RESERVED_PORTS add eax, RESERVED_PORTS
;mov ebx, [current_slot]
;mov ebx, [ebx+APPDATA.tid]
mov ebx, [TASK_BASE] mov ebx, [TASK_BASE]
mov ebx, [ebx+TASKDATA.pid] mov ebx, [ebx+TASKDATA.pid]
mov [eax], ebx mov [eax], ebx
@ -3702,6 +3641,8 @@ free_port_area:
mov eax, [RESERVED_PORTS]; no reserved areas ? mov eax, [RESERVED_PORTS]; no reserved areas ?
test eax, eax test eax, eax
jz frpal2 jz frpal2
;mov ebx, [current_slot]
;mov ebx, [ebx+APPDATA.tid]
mov ebx, [TASK_BASE] mov ebx, [TASK_BASE]
mov ebx, [ebx+TASKDATA.pid] mov ebx, [ebx+TASKDATA.pid]
frpal3: frpal3:
@ -4489,6 +4430,8 @@ align 4
mov eax, [current_slot_idx] mov eax, [current_slot_idx]
shl eax, 5 shl eax, 5
mov eax, [eax+TASK_TABLE+TASKDATA.pid] mov eax, [eax+TASK_TABLE+TASKDATA.pid]
;shl eax, 8
;mov eax, [eax+SLOT_BASE+APPDATA.tid]
; set current PID for lock input ; set current PID for lock input
mov [PID_lock_input], eax mov [PID_lock_input], eax
@@: @@:
@ -4504,6 +4447,8 @@ align 4
mov ebx, [current_slot_idx] mov ebx, [current_slot_idx]
shl ebx, 5 shl ebx, 5
mov ebx, [ebx+TASK_TABLE+TASKDATA.pid] mov ebx, [ebx+TASK_TABLE+TASKDATA.pid]
;shl ebx, 8
;mov ebx, [ebx+SLOT_BASE+APPDATA.tid]
; compare current lock input with current PID ; compare current lock input with current PID
cmp ebx, eax cmp ebx, eax
jne @f jne @f