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
|
call write_process_memory
|
||||||
; new debug event
|
; new debug event
|
||||||
mov eax, ebp
|
mov eax, ebp
|
||||||
shl eax, 8
|
shl eax, BSF sizeof.APPDATA
|
||||||
or byte [SLOT_BASE+eax+APPDATA.occurred_events+1], 1 ; set flag 100h
|
or [SLOT_BASE+eax+APPDATA.occurred_events], EVENT_DEBUG
|
||||||
.ret:
|
.ret:
|
||||||
ret
|
ret
|
||||||
|
@ -1042,8 +1042,8 @@ proc sys_ipc_send stdcall, PID:dword, msg_addr:dword, msg_size:dword
|
|||||||
invlpg [edx]
|
invlpg [edx]
|
||||||
|
|
||||||
mov eax, [dst_slot]
|
mov eax, [dst_slot]
|
||||||
shl eax, 8
|
shl eax, BSF sizeof.APPDATA
|
||||||
or [eax+SLOT_BASE+0xA8], dword 0x40
|
or [eax+SLOT_BASE+APPDATA.occurred_events], EVENT_IPC
|
||||||
push 0
|
push 0
|
||||||
jmp .ret
|
jmp .ret
|
||||||
.no_pid:
|
.no_pid:
|
||||||
|
@ -152,7 +152,7 @@ exc_c: ; exceptions (all but 7th - #NM)
|
|||||||
; not debuggee => say error and terminate
|
; not debuggee => say error and terminate
|
||||||
call show_error_parameters
|
call show_error_parameters
|
||||||
sti
|
sti
|
||||||
mov [edx + TASKDATA.state], TSTATE_TERMINATING ; terminate
|
mov [edx + TASKDATA.state], TSTATE_TERMINATING
|
||||||
call wakeup_osloop
|
call wakeup_osloop
|
||||||
call change_task
|
call change_task
|
||||||
; If we're here, then the main OS thread has crashed before initializing IDLE thread.
|
; 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
|
call debugger_notify ;; only ONE using, inline ??? SEE: core/debug.inc
|
||||||
add esp, 12
|
add esp, 12
|
||||||
mov edx, [TASK_BASE]
|
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
|
call change_task ; SEE: core/shed.inc
|
||||||
restore_ring3_context
|
restore_ring3_context
|
||||||
iretd
|
iretd
|
||||||
|
@ -281,7 +281,7 @@ Wait_events_ex:
|
|||||||
mov eax, [timer_ticks]
|
mov eax, [timer_ticks]
|
||||||
mov [esi+APPDATA.wait_begin], eax
|
mov [esi+APPDATA.wait_begin], eax
|
||||||
mov eax, [TASK_BASE]
|
mov eax, [TASK_BASE]
|
||||||
mov [eax+TASKDATA.state], 5
|
mov [eax+TASKDATA.state], TSTATE_WAITING
|
||||||
call change_task
|
call change_task
|
||||||
mov eax, [esi+APPDATA.wait_param]
|
mov eax, [esi+APPDATA.wait_param]
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
|
@ -2363,7 +2363,7 @@ sysfn_zmodif:
|
|||||||
mov eax, edx
|
mov eax, edx
|
||||||
shl edx, 5
|
shl edx, 5
|
||||||
|
|
||||||
cmp [edx + TASK_TABLE + TASKDATA.state], 9
|
cmp [edx + TASK_TABLE + TASKDATA.state], TSTATE_FREE
|
||||||
je .fail
|
je .fail
|
||||||
|
|
||||||
cmp ecx, 1
|
cmp ecx, 1
|
||||||
@ -3606,7 +3606,7 @@ align 4
|
|||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
align 4
|
align 4
|
||||||
.set:
|
.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
|
align 4
|
||||||
.skip:
|
.skip:
|
||||||
@ -3674,7 +3674,7 @@ set_bgr_event:
|
|||||||
mov [edi+SLOT_BASE+APPDATA.draw_bgr_x], eax
|
mov [edi+SLOT_BASE+APPDATA.draw_bgr_x], eax
|
||||||
mov [edi+SLOT_BASE+APPDATA.draw_bgr_y], edx
|
mov [edi+SLOT_BASE+APPDATA.draw_bgr_y], edx
|
||||||
.common:
|
.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
|
loop set_bgr_event
|
||||||
pop edi ecx
|
pop edi ecx
|
||||||
;--------- set event 5 stop -----------
|
;--------- set event 5 stop -----------
|
||||||
|
@ -133,7 +133,7 @@ align 4
|
|||||||
list_add_tail esp, esi ;esp= new waiter, esi= list head
|
list_add_tail esp, esi ;esp= new waiter, esi= list head
|
||||||
mov eax, edx
|
mov eax, edx
|
||||||
.again:
|
.again:
|
||||||
mov [ebx+TASKDATA.state], 1
|
mov [ebx+TASKDATA.state], TSTATE_RUN_SUSPENDED
|
||||||
call change_task
|
call change_task
|
||||||
|
|
||||||
lock cmpxchg [ecx], edx
|
lock cmpxchg [ecx], edx
|
||||||
@ -180,7 +180,7 @@ align 4
|
|||||||
mov eax, [timer_ticks]
|
mov eax, [timer_ticks]
|
||||||
mov [ebx+APPDATA.wait_begin], eax
|
mov [ebx+APPDATA.wait_begin], eax
|
||||||
mov eax, [TASK_BASE]
|
mov eax, [TASK_BASE]
|
||||||
mov [eax+TASKDATA.state], 5
|
mov [eax+TASKDATA.state], TSTATE_WAITING
|
||||||
|
|
||||||
mov [esp+MUTEX_WAITER.task], eax
|
mov [esp+MUTEX_WAITER.task], eax
|
||||||
lea esi, [ebp+FUTEX.wait_list]
|
lea esi, [ebp+FUTEX.wait_list]
|
||||||
@ -232,7 +232,7 @@ align 4
|
|||||||
je .done
|
je .done
|
||||||
|
|
||||||
mov eax, [esi+MUTEX_WAITER.task]
|
mov eax, [esi+MUTEX_WAITER.task]
|
||||||
mov [eax+TASKDATA.state], 0
|
mov [eax+TASKDATA.state], TSTATE_RUNNING
|
||||||
|
|
||||||
mov esi, [esi+MUTEX_WAITER.list.next]
|
mov esi, [esi+MUTEX_WAITER.list.next]
|
||||||
inc ecx
|
inc ecx
|
||||||
|
@ -181,7 +181,7 @@ pipe_read:
|
|||||||
je @F
|
je @F
|
||||||
|
|
||||||
mov ecx, [ecx+MUTEX_WAITER.task]
|
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
|
cmp [ebp+PIPE.count], 0
|
||||||
je @F
|
je @F
|
||||||
@ -191,7 +191,7 @@ pipe_read:
|
|||||||
je @F
|
je @F
|
||||||
|
|
||||||
mov eax, [eax+MUTEX_WAITER.task]
|
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]
|
lea ecx, [ebp+PIPE.pipe_lock]
|
||||||
call mutex_unlock
|
call mutex_unlock
|
||||||
@ -211,7 +211,7 @@ pipe_read:
|
|||||||
lea ecx, [ebp+PIPE.pipe_lock]
|
lea ecx, [ebp+PIPE.pipe_lock]
|
||||||
call mutex_unlock
|
call mutex_unlock
|
||||||
|
|
||||||
mov [ebx+TASKDATA.state], 1
|
mov [ebx+TASKDATA.state], TSTATE_RUN_SUSPENDED
|
||||||
call change_task
|
call change_task
|
||||||
|
|
||||||
lea ecx, [ebp+PIPE.pipe_lock]
|
lea ecx, [ebp+PIPE.pipe_lock]
|
||||||
@ -276,7 +276,7 @@ pipe_write:
|
|||||||
je @F
|
je @F
|
||||||
|
|
||||||
mov eax, [eax+MUTEX_WAITER.task]
|
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
|
cmp [ebp+PIPE.count], 4096
|
||||||
je @F
|
je @F
|
||||||
@ -286,7 +286,7 @@ pipe_write:
|
|||||||
je @F
|
je @F
|
||||||
|
|
||||||
mov ecx, [eax+MUTEX_WAITER.task]
|
mov ecx, [eax+MUTEX_WAITER.task]
|
||||||
mov [ecx+TASKDATA.state], 0 ;activate writer task
|
mov [ecx+TASKDATA.state], TSTATE_RUNNING ;activate writer task
|
||||||
@@:
|
@@:
|
||||||
popfd
|
popfd
|
||||||
|
|
||||||
@ -314,7 +314,7 @@ pipe_write:
|
|||||||
lea ecx, [ebp+PIPE.pipe_lock]
|
lea ecx, [ebp+PIPE.pipe_lock]
|
||||||
call mutex_unlock
|
call mutex_unlock
|
||||||
|
|
||||||
mov [ecx+TASKDATA.state], 1
|
mov [ecx+TASKDATA.state], TSTATE_RUN_SUSPENDED
|
||||||
call change_task
|
call change_task
|
||||||
|
|
||||||
lea ecx, [ebp+PIPE.pipe_lock]
|
lea ecx, [ebp+PIPE.pipe_lock]
|
||||||
|
Loading…
Reference in New Issue
Block a user