Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 9612 → Rev 9613

/kernel/trunk/core/taskman.inc
474,8 → 474,10
 
align 4
get_pid:
mov eax, [TASK_BASE]
mov eax, [eax+TASKDATA.pid]
mov eax, [current_slot]
mov eax, [eax+APPDATA.tid]
mov eax, [TASK_BASE] ; delete
mov eax, [eax+TASKDATA.pid] ;
ret
 
pid_to_slot:
488,10 → 490,12
push ecx
mov ebx, [thread_count]
shl ebx, BSF sizeof.TASKDATA ; multiply by size
;shl ebx, BSF sizeof.APPDATA ; multiply by size
; add 2*32 cause:
; [TASK_TABLE; TASK_TABLE + 32) isnt a task actually
; skip first process in the task table
mov ecx, 2*32
mov ecx, 2*32 ;sizeof.TASKDATA
;mov ecx, sizeof.APPDATA
 
.loop:
;ecx = offset of current process info entry
500,8 → 504,13
jz .endloop ;skip empty slots
cmp [TASK_TABLE+ecx+TASKDATA.pid], eax;check PID
jz .pid_found
;cmp [ecx+SLOT_BASE+APPDATA.state], TSTATE_FREE
;jz .endloop ;skip empty slots
;cmp [ecx+SLOT_BASE+APPDATA.pid], eax;check PID
;jz .pid_found
.endloop:
add ecx, sizeof.TASKDATA
;add ecx, sizeof.APPDATA
cmp ecx, ebx
jle .loop
 
512,6 → 521,7
 
.pid_found:
shr ecx, BSF sizeof.TASKDATA ; divide by size
;shr ecx, BSF sizeof.APPDATA
mov eax, ecx ;convert offset to index of slot
pop ecx
pop ebx
896,6 → 906,8
mov ebx, [current_slot]
cmp [ebx+APPDATA.debugger_slot], 0
je .exit
;mov eax, [current_slot]
mov [ebx+APPDATA.state], TSTATE_RUN_SUSPENDED
mov eax, [TASK_BASE]
mov [eax+TASKDATA.state], TSTATE_RUN_SUSPENDED
call change_task
974,6 → 986,10
;shr ebx, 3
;mov dword [TASK_TABLE+ebx+TASKDATA.mem_start], 0
mov dword [ebx+SLOT_BASE+APPDATA.mem_start], 0
mov [ebx+SLOT_BASE+APPDATA.event_mask], dword 1+2+4;set default event flags (see 40 function)
inc dword [process_number]
mov eax, [process_number]
mov [ebx+SLOT_BASE+APPDATA.tid], eax ;set TID
 
mov eax, [slot]
mov [ebx+SLOT_BASE+APPDATA.wnd_number], al
989,9 → 1005,8
 
mov [ebx+TASKDATA.event_mask], dword 1+2+4;set default event flags (see 40 function)
 
inc dword [process_number]
mov eax, [process_number]
mov [ebx+TASKDATA.pid], eax ;set PID
mov eax, [process_number] ; delete
mov [ebx+TASKDATA.pid], eax ;set PID ;
 
;set draw data to full screen
xor eax, eax
1047,6 → 1062,8
mov [SLOT_BASE+ebx*8+APPDATA.debugger_slot], eax
.no_debug:
mov [TASK_TABLE+ebx+TASKDATA.state], dl
;shl ebx, 3
;mov [ebx+SLOT_BASE+APPDATA.state], dl
lea edx, [SLOT_BASE+ebx*8]
call scheduler_add_thread
ret
/kernel/trunk/gui/event.inc
68,6 → 68,8
;scratched: ebx,ecx,esi,edi
mov ebx, [current_slot]
add ebx, APP_OBJ_OFFSET
;mov edx, [cyrrent_slot]
;mov edx, [edx+APPDATA.tid]
mov edx, [TASK_BASE]
mov edx, [edx+TASKDATA.pid]
pushfd
280,6 → 282,7
mov [esi+APPDATA.wait_timeout], ebx
mov eax, [timer_ticks]
mov [esi+APPDATA.wait_begin], eax
mov [esi+APPDATA.state], TSTATE_WAITING
mov eax, [TASK_BASE]
mov [eax+TASKDATA.state], TSTATE_WAITING
call change_task
510,6 → 513,8
;retval:
; eax - event number (=0 => no events)
movzx edi, bh ; bh is assumed as [current_slot_idx]
;shl edi, 8
;mov ecx, [edi+SLOT_BASE+APPDATA.event_mask]
shl edi, 5
add edi, TASK_TABLE ; edi is assumed as [TASK_BASE]
mov ecx, [edi+TASKDATA.event_mask]
552,6 → 557,8
align 4
.mouse_check: ; Mouse 5+1=6
push eax
;mov eax, [current_slot]
;mov eax, [eax + APPDATA.event_mask]
mov eax, [TASK_BASE]
mov eax, [eax + TASKDATA.event_mask]
test eax, 0x80000000 ; bit 31: active/inactive filter f.40
/kernel/trunk/kernel.asm
2201,10 → 2201,13
 
mov eax, edx
shl edx, 5
;shl edx, 8
 
;cmp [edx + SLOT_BASE + APPDATA.state], TSTATE_FREE
cmp [edx + TASK_TABLE + TASKDATA.state], TSTATE_FREE
je .fail
 
;shr edx, 3
cmp ecx, 1
jnz .set_zmod
 
2665,6 → 2668,7
stosd
 
; +30: PID/TID
mov eax, [ecx*8 + SLOT_BASE + APPDATA.tid]
mov eax, [ecx+TASK_TABLE+TASKDATA.pid]
stosd
 
2677,6 → 2681,7
movsd
 
; Process state (+50)
movzx eax, byte [ecx*8 + SLOT_BASE + APPDATA.state]
movzx eax, byte [ecx+TASK_TABLE+TASKDATA.state]
stosd
 
2692,7 → 2697,8
stosb
 
; Event mask (+71)
mov EAX, dword [ECX+TASK_TABLE+TASKDATA.event_mask]
mov EAX, dword [ecx*8 + SLOT_BASE + APPDATA.event_mask]
mov EAX, dword [ECX+TASK_TABLE+TASKDATA.event_mask] ; delete
stosd
 
; Keyboard mode (+75)