forked from KolibriOS/kolibrios
[KERNEL] use constants instead of hardcoded values, other small fixes
git-svn-id: svn://kolibrios.org@8876 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
af4b3b8c45
commit
0f675e4534
@ -449,7 +449,7 @@ debugger_notify:
|
||||
call write_process_memory
|
||||
; new debug event
|
||||
mov eax, ebp
|
||||
shl eax, 8
|
||||
or byte [SLOT_BASE+eax+APPDATA.occurred_events+1], 1 ; set flag 100h
|
||||
shl eax, BSF sizeof.APPDATA
|
||||
or [SLOT_BASE+eax+APPDATA.occurred_events], EVENT_DEBUG
|
||||
.ret:
|
||||
ret
|
||||
|
@ -1042,8 +1042,8 @@ proc sys_ipc_send stdcall, PID:dword, msg_addr:dword, msg_size:dword
|
||||
invlpg [edx]
|
||||
|
||||
mov eax, [dst_slot]
|
||||
shl eax, 8
|
||||
or [eax+SLOT_BASE+0xA8], dword 0x40
|
||||
shl eax, BSF sizeof.APPDATA
|
||||
or [eax+SLOT_BASE+APPDATA.occurred_events], EVENT_IPC
|
||||
push 0
|
||||
jmp .ret
|
||||
.no_pid:
|
||||
|
@ -152,7 +152,7 @@ exc_c: ; exceptions (all but 7th - #NM)
|
||||
; not debuggee => say error and terminate
|
||||
call show_error_parameters
|
||||
sti
|
||||
mov [edx + TASKDATA.state], TSTATE_TERMINATING ; terminate
|
||||
mov [edx + TASKDATA.state], TSTATE_TERMINATING
|
||||
call wakeup_osloop
|
||||
call change_task
|
||||
; If we're here, then the main OS thread has crashed before initializing IDLE thread.
|
||||
@ -187,7 +187,7 @@ exc_c: ; exceptions (all but 7th - #NM)
|
||||
call debugger_notify ;; only ONE using, inline ??? SEE: core/debug.inc
|
||||
add esp, 12
|
||||
mov edx, [TASK_BASE]
|
||||
mov [edx+TASKDATA.state], TSTATE_RUN_SUSPENDED ; suspended
|
||||
mov [edx+TASKDATA.state], TSTATE_RUN_SUSPENDED
|
||||
call change_task ; SEE: core/shed.inc
|
||||
restore_ring3_context
|
||||
iretd
|
||||
|
@ -281,7 +281,7 @@ Wait_events_ex:
|
||||
mov eax, [timer_ticks]
|
||||
mov [esi+APPDATA.wait_begin], eax
|
||||
mov eax, [TASK_BASE]
|
||||
mov [eax+TASKDATA.state], 5
|
||||
mov [eax+TASKDATA.state], TSTATE_WAITING
|
||||
call change_task
|
||||
mov eax, [esi+APPDATA.wait_param]
|
||||
;--------------------------------------
|
||||
|
@ -2363,7 +2363,7 @@ sysfn_zmodif:
|
||||
mov eax, edx
|
||||
shl edx, 5
|
||||
|
||||
cmp [edx + TASK_TABLE + TASKDATA.state], 9
|
||||
cmp [edx + TASK_TABLE + TASKDATA.state], TSTATE_FREE
|
||||
je .fail
|
||||
|
||||
cmp ecx, 1
|
||||
@ -3606,7 +3606,7 @@ align 4
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.set:
|
||||
or [edi+SLOT_BASE+APPDATA.occurred_events], 100000b ; set event 6; TODO use constant
|
||||
or [edi+SLOT_BASE+APPDATA.occurred_events], EVENT_MOUSE
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.skip:
|
||||
@ -3674,7 +3674,7 @@ set_bgr_event:
|
||||
mov [edi+SLOT_BASE+APPDATA.draw_bgr_x], eax
|
||||
mov [edi+SLOT_BASE+APPDATA.draw_bgr_y], edx
|
||||
.common:
|
||||
or [edi+SLOT_BASE+APPDATA.occurred_events], 10000b ; set event 5; TODO use constant
|
||||
or [edi+SLOT_BASE+APPDATA.occurred_events], EVENT_BACKGROUND
|
||||
loop set_bgr_event
|
||||
pop edi ecx
|
||||
;--------- set event 5 stop -----------
|
||||
|
@ -133,7 +133,7 @@ align 4
|
||||
list_add_tail esp, esi ;esp= new waiter, esi= list head
|
||||
mov eax, edx
|
||||
.again:
|
||||
mov [ebx+TASKDATA.state], 1
|
||||
mov [ebx+TASKDATA.state], TSTATE_RUN_SUSPENDED
|
||||
call change_task
|
||||
|
||||
lock cmpxchg [ecx], edx
|
||||
@ -180,7 +180,7 @@ align 4
|
||||
mov eax, [timer_ticks]
|
||||
mov [ebx+APPDATA.wait_begin], eax
|
||||
mov eax, [TASK_BASE]
|
||||
mov [eax+TASKDATA.state], 5
|
||||
mov [eax+TASKDATA.state], TSTATE_WAITING
|
||||
|
||||
mov [esp+MUTEX_WAITER.task], eax
|
||||
lea esi, [ebp+FUTEX.wait_list]
|
||||
@ -232,7 +232,7 @@ align 4
|
||||
je .done
|
||||
|
||||
mov eax, [esi+MUTEX_WAITER.task]
|
||||
mov [eax+TASKDATA.state], 0
|
||||
mov [eax+TASKDATA.state], TSTATE_RUNNING
|
||||
|
||||
mov esi, [esi+MUTEX_WAITER.list.next]
|
||||
inc ecx
|
||||
|
@ -181,7 +181,7 @@ pipe_read:
|
||||
je @F
|
||||
|
||||
mov ecx, [ecx+MUTEX_WAITER.task]
|
||||
mov [ecx+TASKDATA.state], 0 ;activate writer task
|
||||
mov [ecx+TASKDATA.state], TSTATE_RUNNING ;activate writer task
|
||||
@@:
|
||||
cmp [ebp+PIPE.count], 0
|
||||
je @F
|
||||
@ -191,7 +191,7 @@ pipe_read:
|
||||
je @F
|
||||
|
||||
mov eax, [eax+MUTEX_WAITER.task]
|
||||
mov [eax+TASKDATA.state], 0 ;activate reader task
|
||||
mov [eax+TASKDATA.state], TSTATE_RUNNING ;activate reader task
|
||||
@@:
|
||||
lea ecx, [ebp+PIPE.pipe_lock]
|
||||
call mutex_unlock
|
||||
@ -211,7 +211,7 @@ pipe_read:
|
||||
lea ecx, [ebp+PIPE.pipe_lock]
|
||||
call mutex_unlock
|
||||
|
||||
mov [ebx+TASKDATA.state], 1
|
||||
mov [ebx+TASKDATA.state], TSTATE_RUN_SUSPENDED
|
||||
call change_task
|
||||
|
||||
lea ecx, [ebp+PIPE.pipe_lock]
|
||||
@ -276,7 +276,7 @@ pipe_write:
|
||||
je @F
|
||||
|
||||
mov eax, [eax+MUTEX_WAITER.task]
|
||||
mov [eax+TASKDATA.state], 0 ;activate reader task
|
||||
mov [eax+TASKDATA.state], TSTATE_RUNNING ;activate reader task
|
||||
@@:
|
||||
cmp [ebp+PIPE.count], 4096
|
||||
je @F
|
||||
@ -286,7 +286,7 @@ pipe_write:
|
||||
je @F
|
||||
|
||||
mov ecx, [eax+MUTEX_WAITER.task]
|
||||
mov [ecx+TASKDATA.state], 0 ;activate writer task
|
||||
mov [ecx+TASKDATA.state], TSTATE_RUNNING ;activate writer task
|
||||
@@:
|
||||
popfd
|
||||
|
||||
@ -314,7 +314,7 @@ pipe_write:
|
||||
lea ecx, [ebp+PIPE.pipe_lock]
|
||||
call mutex_unlock
|
||||
|
||||
mov [ecx+TASKDATA.state], 1
|
||||
mov [ecx+TASKDATA.state], TSTATE_RUN_SUSPENDED
|
||||
call change_task
|
||||
|
||||
lea ecx, [ebp+PIPE.pipe_lock]
|
||||
|
Loading…
Reference in New Issue
Block a user