/kernel/trunk/core/debug.inc |
---|
19,7 → 19,7 |
debug_set_event_data: |
; in: ebx = pointer |
; destroys eax |
mov eax, [0x3000] |
mov eax, [CURRENT_TASK] |
shl eax, 8 |
mov [eax+0x80000+APPDATA.dbg_event_mem], ebx |
ret |
36,7 → 36,7 |
jz .ret_bad |
shl eax, 5 |
push ebx |
mov ebx, [0x3000] |
mov ebx, [CURRENT_TASK] |
cmp [0x80000+eax*8+APPDATA.debugger_slot], ebx |
pop ebx |
jnz .ret_bad |
72,13 → 72,13 |
; destroys eax,ebx |
call get_debuggee_slot |
jc .ret |
mov bl, [0x3000+eax+TASKDATA.state] ; process state |
mov bl, [CURRENT_TASK+eax+TASKDATA.state] ; process state |
test bl, bl |
jz .1 |
cmp bl, 5 |
jnz .ret |
mov bl, 2 |
.2: mov [0x3000+eax+TASKDATA.state], bl |
.2: mov [CURRENT_TASK+eax+TASKDATA.state], bl |
.ret: |
sti |
ret |
87,13 → 87,13 |
jmp .2 |
do_resume: |
mov bl, [0x3000+eax+TASKDATA.state] |
mov bl, [CURRENT_TASK+eax+TASKDATA.state] |
cmp bl, 1 |
jz .1 |
cmp bl, 2 |
jnz .ret |
mov bl, 5 |
.2: mov [0x3000+eax+TASKDATA.state], bl |
.2: mov [CURRENT_TASK+eax+TASKDATA.state], bl |
.ret: ret |
.1: dec ebx |
jmp .2 |
380,7 → 380,7 |
pop ecx |
pop ecx |
pop ecx |
cmp dword [0x3000], 1 |
cmp dword [CURRENT_TASK], 1 |
jnz .notos |
cmp [timer_ticks], edi |
jae .ret |
430,7 → 430,7 |
jns @f |
; this is exception from task switch |
; set DRx registers for task and continue |
mov eax, [0x3000] |
mov eax, [CURRENT_TASK] |
shl eax, 8 |
add eax, 0x80000+APPDATA.dbg_regs |
mov ecx, [eax+0] |
453,7 → 453,7 |
mov dr6, eax |
; test if debugging |
cli |
mov eax, [0x3000] |
mov eax, [CURRENT_TASK] |
shl eax, 8 |
mov eax, [0x80000+eax+APPDATA.debugger_slot] |
test eax, eax |
463,7 → 463,7 |
add esp, 28h+4 |
mov [error_interrupt], 1 |
call show_error_parameters |
mov edx, [0x3010] |
mov edx, [TASK_BASE] |
mov byte [edx+TASKDATA.state], 4 |
jmp change_task |
.debug: |
483,7 → 483,7 |
cmp cl, not 10h |
jnz .l1 |
push edx ; DR6 image |
mov ecx, [0x3010] |
mov ecx, [TASK_BASE] |
push dword [ecx+TASKDATA.pid] ; PID |
push 12 |
pop ecx |
492,7 → 492,7 |
pop ecx |
pop ecx |
pop ecx |
mov edx, [0x3010] |
mov edx, [TASK_BASE] |
mov byte [edx+TASKDATA.state], 1 ; suspended |
call change_task |
restore_ring3_context |
/kernel/trunk/core/memory.inc |
---|
395,7 → 395,7 |
mov edx, LFB_BASE |
mov esi, [LFBAddress] |
mov edi, [LFBSize] |
mov dword [exp_lfb+4], esi |
mov dword [exp_lfb+4], edx |
shr edi, 12 |
mov [pg_count], edi |
/kernel/trunk/core/sched.inc |
---|
67,11 → 67,11 |
jne .find_next_task |
mov [dma_task_switched], 0 |
mov ebx, [dma_process] |
cmp [0x3000], ebx |
cmp [CURRENT_TASK], ebx |
je .return |
mov edi, [dma_slot_ptr] |
mov [0x3000], ebx |
mov [0x3010], edi |
mov [CURRENT_TASK], ebx |
mov [TASK_BASE], edi |
jmp @f |
.find_next_task: |
; \end{Mario79} |
103,7 → 103,7 |
update_counters: |
mov edi, [0x3010] |
mov edi, [TASK_BASE] |
mov ebx, [edi+TASKDATA.counter_add] ; time stamp counter add |
call _rdtsc |
sub eax, ebx |
119,8 → 119,8 |
; [0x3000] = ebx and [0x3010] = edi |
; corrupts other regs |
find_next_task: |
mov ebx, [0x3000] |
mov edi, [0x3010] |
mov ebx, [CURRENT_TASK] |
mov edi, [TASK_BASE] |
mov [prev_slot], ebx |
.waiting_for_termination: |
127,9 → 127,9 |
.waiting_for_reuse: |
.waiting_for_event: |
.suspended: |
cmp ebx, [0x3004] |
cmp ebx, [TASK_COUNT] |
jb @f |
mov edi, 0x3000 |
mov edi, CURRENT_TASK |
xor ebx, ebx |
@@: |
150,8 → 150,8 |
cmp al, 9 |
je .waiting_for_reuse |
mov [0x3000],ebx |
mov [0x3010],edi |
mov [CURRENT_TASK],ebx |
mov [TASK_BASE],edi |
cmp al, 5 |
jne .noevents |
162,8 → 162,8 |
mov [edi+TASKDATA.state], byte 0 |
.noevents: |
.found: |
mov [0x3000],ebx |
mov [0x3010],edi |
mov [CURRENT_TASK],ebx |
mov [TASK_BASE],edi |
call _rdtsc |
mov [edi+TASKDATA.counter_add],eax |
191,8 → 191,8 |
mov eax,[idleuse] |
mov [idleusesec],eax |
mov [idleuse],dword 0 |
mov ecx, [0x3004] |
mov edi, 0x3020 |
mov ecx, [TASK_COUNT] |
mov edi, TASK_DATA |
.newupdate: |
mov ebx,[edi+TASKDATA.counter_sum] |
mov [edi+TASKDATA.cpu_usage],ebx |
/kernel/trunk/core/sync.inc |
---|
26,7 → 26,7 |
jmp start_wait |
ok=$ |
push eax |
mov eax,dword [0x3010+second_base_address] |
mov eax,dword [TASK_BASE+second_base_address] |
mov eax,[eax+TASKDATA.pid] |
mov [name],eax |
pop eax |
60,7 → 60,7 |
{ |
local start_wait,first_wait,inc_counter,end_wait |
push eax |
mov eax,[0x3010+second_base_address] |
mov eax,[TASK_BASE+second_base_address] |
mov eax,[eax+TASKDATA.pid] |
start_wait=$ |
cli |
92,7 → 92,7 |
macro TryWaitSimpleCriticalSection name ;result in eax and in flags |
{ |
local ok,try_end |
mov eax,[0x3000+second_base_address] |
mov eax,[CURRENT_TASK+second_base_address] |
mov eax,[eax+TASKDATA.pid] |
cmp [name],eax |
jz ok |
/kernel/trunk/core/sys32.inc |
---|
120,7 → 120,7 |
; test if debugging |
cli |
mov eax, [0x3000] |
mov eax, [CURRENT_TASK] |
shl eax, 8 |
mov eax, [0x80000+eax+APPDATA.debugger_slot] |
test eax, eax |
132,7 → 132,7 |
mov [error_interrupt], eax |
call show_error_parameters |
mov edx, [0x3010] |
mov edx, [TASK_BASE] |
mov [edx + TASKDATA.state], byte 4 |
jmp change_task |
143,7 → 143,7 |
cld |
movzx ecx, bl |
push ecx |
mov ecx, [0x3010] |
mov ecx, [TASK_BASE] |
push dword [ecx+TASKDATA.pid] ; PID of current process |
push 12 |
pop ecx |
152,7 → 152,7 |
pop ecx |
pop ecx |
pop ecx |
mov edx, [0x3010] |
mov edx, [TASK_BASE] |
mov byte [edx+TASKDATA.state], 1 ; suspended |
call change_task |
restore_ring3_context |
196,9 → 196,9 |
show_error_parameters: |
mov [write_error_to],process_pid+43 |
mov eax,[0x3000] |
mov eax,[CURRENT_TASK] |
shl eax, 5 |
mov eax,[0x3000+TASKDATA.pid+eax] |
mov eax,[CURRENT_TASK+TASKDATA.pid+eax] |
call writehex |
mov [write_error_to],process_error+43 |
433,9 → 433,9 |
set_application_table_status: |
push eax |
mov eax,[0x3000] |
mov eax,[CURRENT_TASK] |
shl eax, 5 |
add eax,0x3000+TASKDATA.pid |
add eax,CURRENT_TASK+TASKDATA.pid |
mov eax,[eax] |
mov [application_table_status],eax |
448,9 → 448,9 |
clear_application_table_status: |
push eax |
mov eax,[0x3000] |
mov eax,[CURRENT_TASK] |
shl eax, 5 |
add eax,0x3000+TASKDATA.pid |
add eax,CURRENT_TASK+TASKDATA.pid |
mov eax,[eax] |
cmp eax,[application_table_status] |
737,7 → 737,7 |
jz .nodebug |
push 8 |
pop ecx |
push dword [0x3000+edi+TASKDATA.pid] ; PID |
push dword [CURRENT_TASK+edi+TASKDATA.pid] ; PID |
push 2 |
call debugger_notify |
pop ecx |
764,7 → 764,7 |
; activate window |
movzx eax, word [0xC000 + esi*2] |
cmp eax, [0x3004] |
cmp eax, [TASK_COUNT] |
jne .dont_activate |
pushad |
.check_next_window: |
774,7 → 774,7 |
lea esi, [0xc400+eax*2] |
movzx edi, word [esi] ; edi = process |
shl edi, 5 |
cmp [0x3000 + edi + TASKDATA.state], byte 9 ; skip dead slots |
cmp [CURRENT_TASK + edi + TASKDATA.state], byte 9 ; skip dead slots |
je .check_next_window |
add edi, window_data |
; \begin{diamond}[19.09.2006] |
789,7 → 789,7 |
push esi ; remove hd1 & cd & flp reservation |
shl esi, 5 |
mov esi, [esi+0x3000+TASKDATA.pid] |
mov esi, [esi+CURRENT_TASK+TASKDATA.pid] |
cmp [hd1_status], esi |
jnz @f |
call free_hd_channel |
809,7 → 809,7 |
pusha ; remove all irq reservations |
mov eax,esi |
shl eax, 5 |
mov eax,[eax+0x3000+TASKDATA.pid] |
mov eax,[eax+CURRENT_TASK+TASKDATA.pid] |
mov edi,irq_owner |
mov ecx,16 |
newirqfree: |
823,7 → 823,7 |
pusha ; remove all port reservations |
mov edx,esi |
shl edx, 5 |
add edx,0x3000 |
add edx,CURRENT_TASK |
mov edx,[edx+TASKDATA.pid] |
rmpr0: |
867,12 → 867,12 |
popa |
mov edi,esi ; do not run this process slot |
shl edi, 5 |
mov [edi+0x3000 + TASKDATA.state],byte 9 |
mov [edi+CURRENT_TASK + TASKDATA.state],byte 9 |
; debugger test - terminate all debuggees |
mov eax, 2 |
mov ecx, 0x80000+2*0x100+APPDATA.debugger_slot |
.xd0: |
cmp eax, [0x3004] |
cmp eax, [TASK_COUNT] |
ja .xd1 |
cmp dword [ecx], esi |
jnz @f |