forked from KolibriOS/kolibrios
cleanup kernel objects in terminate()
git-svn-id: svn://kolibrios.org@329 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
5a467f60e3
commit
82fe412a09
@ -543,20 +543,20 @@ get_app_params:
|
||||
stc
|
||||
ret
|
||||
|
||||
uglobal
|
||||
new_process_place dd 0x0
|
||||
app_start dd 0x0
|
||||
app_i_end dd 0x0
|
||||
app_mem dd 0x0
|
||||
app_esp dd 0x0
|
||||
app_i_param dd 0x0
|
||||
app_i_icon dd 0x0
|
||||
app_mem_pos dd 0x0
|
||||
endg
|
||||
|
||||
end if
|
||||
|
||||
|
||||
;uglobal
|
||||
; new_process_place dd 0x0
|
||||
; app_start dd 0x0
|
||||
; app_i_end dd 0x0
|
||||
; app_mem dd 0x0
|
||||
; app_esp dd 0x0
|
||||
; app_i_param dd 0x0
|
||||
; app_i_icon dd 0x0
|
||||
; app_mem_pos dd 0x0
|
||||
;endg
|
||||
|
||||
sys_threads:
|
||||
|
||||
; eax=1 create thread
|
||||
@ -570,15 +570,19 @@ jmp new_sys_threads
|
||||
iglobal
|
||||
process_terminating db 'K : Process - terminating',13,10,0
|
||||
process_terminated db 'K : Process - done',13,10,0
|
||||
msg_obj_destroy db 'K : destroy app object',13,10,0
|
||||
endg
|
||||
|
||||
; param
|
||||
; esi= slot
|
||||
|
||||
terminate: ; terminate application
|
||||
push esi
|
||||
|
||||
.slot equ esp ;locals
|
||||
|
||||
push esi ;save .slot
|
||||
mov esi,process_terminating
|
||||
call sys_msg_board_str
|
||||
pop esi
|
||||
|
||||
@@:
|
||||
cli
|
||||
cmp [application_table_status],0
|
||||
@ -586,24 +590,38 @@ terminate: ; terminate application
|
||||
sti
|
||||
call change_task
|
||||
jmp @b
|
||||
term9:
|
||||
|
||||
term9:
|
||||
call set_application_table_status
|
||||
|
||||
mov eax,esi
|
||||
mov esi, [.slot]
|
||||
shl esi,8
|
||||
add esi, PROC_BASE+APP_OBJ_OFFSET
|
||||
@@:
|
||||
mov eax, [esi+APPOBJ.fd]
|
||||
cmp eax, esi
|
||||
je @F
|
||||
|
||||
pushad
|
||||
shl eax,8
|
||||
mov eax,[PROC_BASE+eax+0xB8]
|
||||
push esi
|
||||
call [eax+APPOBJ.destroy]
|
||||
mov esi, msg_obj_destroy
|
||||
call sys_msg_board_str
|
||||
pop esi
|
||||
jmp @B
|
||||
@@:
|
||||
mov eax, [.slot]
|
||||
shl eax, 8
|
||||
mov eax,[PROC_BASE+eax+APPDATA.dir_table]
|
||||
stdcall destroy_app_space, eax
|
||||
popad
|
||||
|
||||
;; mov esi, [.slot]
|
||||
pop esi ;restore stack
|
||||
cmp [fpu_owner],esi ; if user fpu last -> fpu user = 1
|
||||
jne fpu_ok_1
|
||||
|
||||
mov [fpu_owner],1
|
||||
mov eax, [256+PROC_BASE+0x10]
|
||||
mov eax, [256+PROC_BASE+APPDATA.fpu_state]
|
||||
bt [cpu_caps], CAPS_SSE
|
||||
clts
|
||||
jnc .no_SSE
|
||||
fxrstor [eax]
|
||||
jmp fpu_ok_1
|
||||
@ -882,7 +900,6 @@ fpu_ok_1:
|
||||
mov [application_table_status],0
|
||||
mov esi,process_terminated
|
||||
call sys_msg_board_str
|
||||
|
||||
ret
|
||||
|
||||
iglobal
|
||||
|
@ -456,8 +456,6 @@ end if
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
|
||||
align 4
|
||||
set_cr3:
|
||||
mov esi, [CURRENT_TASK]
|
||||
|
Loading…
Reference in New Issue
Block a user