Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 8868 → Rev 8869

/kernel/trunk/core/debug.inc
48,7 → 48,7
jz .ret_bad
shl eax, 5
push ebx
mov ebx, [CURRENT_TASK]
mov ebx, [current_slot_idx]
cmp [SLOT_BASE+eax*8+APPDATA.debugger_slot], ebx
pop ebx
jnz .ret_bad
92,7 → 92,7
call get_debuggee_slot
jc .ret
; } End patch
mov cl, [CURRENT_TASK+eax+TASKDATA.state] ; process state
mov cl, [TASK_TABLE+eax+TASKDATA.state] ; process state
test cl, cl
jz .1
cmp cl, 5
99,7 → 99,7
jnz .ret
mov cl, 2
.2:
mov [CURRENT_TASK+eax+TASKDATA.state], cl
mov [TASK_TABLE+eax+TASKDATA.state], cl
.ret:
sti
ret
108,7 → 108,7
jmp .2
 
do_resume:
mov cl, [CURRENT_TASK+eax+TASKDATA.state]
mov cl, [TASK_TABLE+eax+TASKDATA.state]
cmp cl, 1
jz .1
cmp cl, 2
115,7 → 115,7
jnz .ret
mov cl, 5
.2:
mov [CURRENT_TASK+eax+TASKDATA.state], cl
mov [TASK_TABLE+eax+TASKDATA.state], cl
.ret:
ret
.1:
416,7 → 416,7
pop ecx
pop ecx
pop ecx
cmp dword [CURRENT_TASK], 1
cmp dword [current_slot_idx], 1
jnz .notos
cmp [timer_ticks], edi
jae .ret
/kernel/trunk/core/dll.inc
354,7 → 354,7
 
align 4
proc get_curr_task
mov eax, [CURRENT_TASK]
mov eax, [current_slot_idx]
shl eax, 8
ret
endp
1211,9 → 1211,9
call malloc
test eax, eax
jz .fail_and_free_user
mov ebx, [CURRENT_TASK]
mov ebx, [current_slot_idx]
shl ebx, 5
mov edx, [CURRENT_TASK+ebx+TASKDATA.pid]
mov edx, [TASK_TABLE+ebx+TASKDATA.pid]
mov [eax+HDLL.pid], edx
push eax
call init_dlls_in_thread
/kernel/trunk/core/fpu.inc
168,7 → 168,7
mov edi, eax
 
mov ecx, [fpu_owner]
mov esi, [CURRENT_TASK]
mov esi, [current_slot_idx]
cmp ecx, esi
jne .save
 
216,7 → 216,7
mov edi, eax
 
mov ecx, [fpu_owner]
mov esi, [CURRENT_TASK]
mov esi, [current_slot_idx]
cmp ecx, esi
jne .save
 
276,7 → 276,7
cli
 
mov ecx, [fpu_owner]
mov eax, [CURRENT_TASK]
mov eax, [current_slot_idx]
cmp ecx, eax
jne .copy
 
318,7 → 318,7
cli
 
mov ecx, [fpu_owner]
mov eax, [CURRENT_TASK]
mov eax, [current_slot_idx]
cmp ecx, eax
jne .copy
 
372,7 → 372,7
mov es, ax
 
mov ebx, [fpu_owner]
cmp ebx, [CURRENT_TASK]
cmp ebx, [current_slot_idx]
je .exit
 
shl ebx, 8
383,7 → 383,7
mov eax, [xsave_eax]
mov edx, [xsave_edx]
xsave [ecx]
mov ebx, [CURRENT_TASK]
mov ebx, [current_slot_idx]
mov [fpu_owner], ebx
shl ebx, 8
mov ecx, [ebx+SLOT_BASE+APPDATA.fpu_state]
396,7 → 396,7
jnc .no_SSE
 
fxsave [eax]
mov ebx, [CURRENT_TASK]
mov ebx, [current_slot_idx]
mov [fpu_owner], ebx
shl ebx, 8
mov eax, [ebx+SLOT_BASE+APPDATA.fpu_state]
406,7 → 406,7
 
.no_SSE:
fnsave [eax]
mov ebx, [CURRENT_TASK]
mov ebx, [current_slot_idx]
mov [fpu_owner], ebx
shl ebx, 8
mov eax, [ebx+SLOT_BASE+APPDATA.fpu_state]
/kernel/trunk/core/heap.inc
1396,9 → 1396,9
mov edx, E_ACCESS
ja .fail
 
mov ebx, [CURRENT_TASK]
shl ebx, 5
mov ebx, [CURRENT_TASK + ebx + 4]
mov ebx, [current_slot_idx]
shl ebx, BSF sizeof.TASKDATA
mov ebx, [TASK_TABLE + ebx + TASKDATA.pid]
mov eax, sizeof.SMAP
 
call create_kernel_object
/kernel/trunk/core/sched.inc
93,7 → 93,7
;param:
; ebx = address of the APPDATA for incoming task (new)
;warning:
; [CURRENT_TASK] and [TASK_BASE] must be changed before (e.g. in find_next_task)
; [current_slot_idx] and [TASK_BASE] must be changed before (e.g. in find_next_task)
; [current_slot] is the outcoming (old), and set here to a new value (ebx)
;scratched: eax,ecx,esi
mov esi, ebx
140,7 → 140,7
mov eax, [xsave_eax]
mov edx, [xsave_edx]
xsave [ecx]
mov ecx, [CURRENT_TASK]
mov ecx, [current_slot_idx]
mov [fpu_owner], ecx
mov ecx, [current_slot]
mov ecx, [ecx+APPDATA.fpu_state]
261,7 → 261,7
; edi = address of the TASKDATA for the selected task
; ZF = 1 if the task is the same
;warning:
; [CURRENT_TASK] = bh , [TASK_BASE] = edi -- as result
; [current_slot_idx] = bh , [TASK_BASE] = edi -- as result
; [current_slot] is not set to new value (ebx)!!!
;scratched: eax,ecx
proc find_next_task
288,7 → 288,7
mov ebx, [ebx+APPDATA.in_schedule.next]
mov edi, ebx
shr edi, 3
add edi, CURRENT_TASK - (SLOT_BASE shr 3)
add edi, TASK_TABLE - (SLOT_BASE shr 3)
mov al, [edi+TASKDATA.state]
test al, al
jz .task_found ; state == 0
328,7 → 328,7
.found:
; the line below assumes APPDATA is 256 bytes long and SLOT_BASE is
; aligned on 0x10000
mov [CURRENT_TASK], bh
mov byte [current_slot_idx], bh
mov [TASK_BASE], edi
rdtsc ;call _rdtsc
mov [edi+TASKDATA.counter_add], eax; for next using update_counters
/kernel/trunk/core/sys32.inc
342,9 → 342,9
mov ecx, application_table_mutex
call mutex_lock
 
mov eax, [CURRENT_TASK]
shl eax, 5
add eax, CURRENT_TASK+TASKDATA.pid
mov eax, [current_slot_idx]
shl eax, BSF sizeof.TASKDATA
add eax, TASK_TABLE+TASKDATA.pid
mov eax, [eax]
 
mov [application_table_owner], eax
418,8 → 418,8
test edx, edx
jnz @F
pop esi
shl esi, 5
mov [CURRENT_TASK+esi+TASKDATA.state], 9
shl esi, BSF sizeof.TASKDATA
mov [TASK_TABLE+esi+TASKDATA.state], 9
ret
@@:
push edx ;save .process
506,8 → 506,8
jb .loop
; get process PID
mov eax, esi
shl eax, 5
mov eax, [eax+CURRENT_TASK+TASKDATA.pid]
shl eax, BSF sizeof.TASKDATA
mov eax, [eax+TASK_TABLE+TASKDATA.pid]
; compare current lock input with process PID
cmp eax, [PID_lock_input]
jne @f
578,12 → 578,12
; debuggee test
pushad
mov edi, esi
shl edi, 5
shl edi, BSF sizeof.TASKDATA
mov eax, [SLOT_BASE+edi*8+APPDATA.debugger_slot]
test eax, eax
jz .nodebug
movi ecx, 8
push dword [CURRENT_TASK+edi+TASKDATA.pid]; PID
push dword [TASK_TABLE+edi+TASKDATA.pid]; PID
push 2
call debugger_notify
pop ecx
638,8 → 638,8
jbe .nothing_to_activate
lea esi, [WIN_POS+eax*2]
movzx edi, word [esi] ; edi = process
shl edi, 5
cmp [CURRENT_TASK + edi + TASKDATA.state], byte 9 ; skip dead slots
shl edi, BSF sizeof.TASKDATA
cmp [TASK_TABLE + edi + TASKDATA.state], byte 9 ; skip dead slots
je .check_next_window
add edi, window_data
; \begin{diamond}[19.09.2006]
653,8 → 653,8
.dont_activate:
 
push esi ; remove hd1 & cd & flp reservation
shl esi, 5
mov esi, [esi+CURRENT_TASK+TASKDATA.pid]
shl esi, BSF sizeof.TASKDATA
mov esi, [esi+TASK_TABLE+TASKDATA.pid]
cmp [cd_status], esi
jnz @f
call free_cd_channel
669,8 → 669,8
 
pusha ; remove all port reservations
mov edx, esi
shl edx, 5
add edx, CURRENT_TASK
shl edx, BSF sizeof.TASKDATA
add edx, TASK_TABLE
mov edx, [edx+TASKDATA.pid]
 
rmpr0:
713,8 → 713,8
 
popa
mov edi, esi ; do not run this process slot
shl edi, 5
mov [edi+CURRENT_TASK + TASKDATA.state], byte 9
shl edi, BSF sizeof.TASKDATA
mov [edi+TASK_TABLE + TASKDATA.state], byte 9
; debugger test - terminate all debuggees
mov eax, 2
mov ecx, SLOT_BASE+2*0x100+APPDATA.debugger_slot
/kernel/trunk/core/taskman.inc
494,7 → 494,7
;ecx = offset of current process info entry
;ebx = maximum permitted offset
; state 9 means "not used"
cmp byte [TASK_TABLE+ecx+TASKDATA.state], 9
cmp byte [TASK_TABLE+ecx+TASKDATA.state], TSTATE_FREE
jz .endloop ;skip empty slots
cmp [TASK_TABLE+ecx+TASKDATA.pid], eax;check PID
jz .pid_found
970,7 → 970,7
rep movsd
 
shr ebx, 3
mov dword [CURRENT_TASK+ebx+0x10], 0
mov dword [TASK_TABLE+ebx+TASKDATA.mem_start], 0
 
mov ebx, [slot]
mov eax, ebx
980,7 → 980,7
; set window state to 'normal' (non-minimized/maximized/rolled-up) state
mov [ebx+window_data+WDATA.fl_wstate], WSTATE_NORMAL
mov [ebx+window_data+WDATA.fl_redraw], 1
add ebx, CURRENT_TASK ;ebx - pointer to information about process
add ebx, TASK_TABLE ;ebx - pointer to information about process
mov [ebx+TASKDATA.wnd_number], al;set window number on screen = process slot
 
mov [ebx+TASKDATA.event_mask], dword 1+2+4;set default event flags (see 40 function)
1039,10 → 1039,10
; set if debuggee
test byte [flags], 1
jz .no_debug
mov eax, [CURRENT_TASK]
mov eax, [current_slot_idx]
mov [SLOT_BASE+ebx*8+APPDATA.debugger_slot], eax
.no_debug:
mov [CURRENT_TASK+ebx+TASKDATA.state], dl
mov [TASK_TABLE+ebx+TASKDATA.state], dl
lea edx, [SLOT_BASE+ebx*8]
call scheduler_add_thread
ret
/kernel/trunk/core/timers.inc
49,7 → 49,7
 
; This internal function acquires the lock for the global list.
lock_timer_list:
mov edx, [CURRENT_TASK]
mov edx, [current_slot_idx]
@@:
xor eax, eax
lock cmpxchg [timer_list_owner], edx
/kernel/trunk/core/v86.inc
827,7 → 827,7
v86_irq2:
mov esi, [v86_irqhooks+edi*8] ; get VM handle
mov eax, [esi+V86_machine.process]
mov ecx, [CURRENT_TASK]
mov ecx, [current_slot_idx]
shl ecx, 8
cmp [SLOT_BASE+ecx+APPDATA.process], eax
jnz .notcurrent
900,7 → 900,7
call update_counters
lea edi, [ebx + 0x100000000 - SLOT_BASE]
shr edi, 3
add edi, CURRENT_TASK
add edi, TASK_TABLE
call find_next_task.found
call do_change_task
popad