Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3533 → Rev 3534

/kernel/trunk/core/taskman.inc
90,7 → 90,7
stdcall set_cursor, [def_cursor_clock]
mov [handle], eax
mov [redrawmouse_unconditional], 1
call __sys_draw_pointer
call wakeup_osloop
popad
@@:
mov [flags], edx
152,20 → 152,8
test eax, eax
jz .err_hdr
 
.wait_lock:
cmp [application_table_status], 0
je .get_lock
call change_task
jmp .wait_lock
call lock_application_table
 
.get_lock:
mov eax, 1
xchg eax, [application_table_status]
test eax, eax
jnz .wait_lock
 
call set_application_table_status
 
call get_new_process_place
test eax, eax
mov esi, -0x20 ; too many processes
246,9 → 234,8
mov eax, [save_cr3]
call set_cr3
 
xor ebx, ebx
mov [application_table_status], ebx;unlock application_table_status mutex
mov eax, [process_number];set result
call unlock_application_table
 
jmp .final
 
259,8 → 246,7
.err_hdr:
stdcall kernel_free, [file_base]
.err_file:
xor eax, eax
mov [application_table_status], eax
call unlock_application_table
mov eax, esi
.final:
cmp [SCR_MODE], word 0x13
268,7 → 254,7
pushad
stdcall set_cursor, [handle]
mov [redrawmouse_unconditional], 1
call __sys_draw_pointer
call wakeup_osloop
popad
@@:
ret
898,20 → 884,8
mov [app_path], eax
;mov esi,new_process_loading
;call sys_msg_board_str
.wait_lock:
cmp [application_table_status], 0
je .get_lock
call change_task
jmp .wait_lock
call lock_application_table
 
.get_lock:
mov eax, 1
xchg eax, [application_table_status]
test eax, eax
jnz .wait_lock
 
call set_application_table_status
 
call get_new_process_place
test eax, eax
jz .failed
967,14 → 941,13
 
;mov esi,new_process_running
;call sys_msg_board_str ;output information about succefull startup
xor eax, eax
mov [application_table_status], eax ;unlock application_table_status mutex
mov eax, [process_number] ;set result
call unlock_application_table
ret
.failed:
xor eax, eax
.failed1:
mov [application_table_status], eax
call unlock_application_table
dec eax ;-1
ret
endp
1148,6 → 1121,7
mov eax, [esi+0x08] ;app_eip
mov [ebx+REG_EIP], eax;app_entry
mov [ebx+REG_CS], dword app_code
mov ecx, USER_PRIORITY
mov eax, [CURRENT_TASK]
shl eax, 8 ; created by kernel?
cmp [SLOT_BASE+eax+APPDATA.dir_table], sys_pgdir - OS_BASE
1155,6 → 1129,7
cmp [app_path], 0 ; it is a thread?
jnz @f
mov [ebx+REG_CS], dword os_code ; kernel thread
mov ecx, MAX_PRIORITY
@@:
mov [ebx+REG_EFLAGS], dword EFL_IOPL1+EFL_IF
 
1162,20 → 1137,22
mov [ebx+REG_APP_ESP], eax;app_stack
mov [ebx+REG_SS], dword app_data
 
lea ecx, [ebx+REG_RET]
lea edx, [ebx+REG_RET]
mov ebx, [slot]
shl ebx, 5
mov [ebx*8+SLOT_BASE+APPDATA.saved_esp], ecx
mov [ebx*8+SLOT_BASE+APPDATA.saved_esp], edx
 
xor ecx, ecx; process state - running
xor edx, edx; process state - running
; set if debuggee
test byte [flags], 1
jz .no_debug
inc ecx ; process state - suspended
inc edx ; process state - suspended
mov eax, [CURRENT_TASK]
mov [SLOT_BASE+ebx*8+APPDATA.debugger_slot], eax
.no_debug:
mov [CURRENT_TASK+ebx+TASKDATA.state], cl
mov [CURRENT_TASK+ebx+TASKDATA.state], dl
lea edx, [SLOT_BASE+ebx*8]
call scheduler_add_thread
;mov esi,new_process_running
;call sys_msg_board_str ;output information about succefull startup
ret