280,6 → 280,7 |
test bl, bl |
jz .start |
mov ebx, [current_slot] |
mov edi, [TASK_BASE] |
mov eax, [ebx+APPDATA.priority] |
test eax, eax |
jz .unlock_found |
292,7 → 293,11 |
jz .priority_next |
.task_loop: |
mov ebx, [ebx+APPDATA.in_schedule.next] |
mov al, [ebx+APPDATA.state] |
;mov al, [ebx+APPDATA.state] |
mov edi, ebx ; |
shr edi, 3 ; |
add edi, TASK_TABLE - (SLOT_BASE shr 3) ; on delete |
mov al, [edi+TASKDATA.state] ; |
test al, al |
jz .task_found ; state == 0 |
cmp al, 5 |
312,6 → 317,7 |
xor eax, eax |
@@: |
mov [ebx+APPDATA.wait_param], eax ; retval for wait |
mov [edi+TASKDATA.state], TSTATE_RUNNING ; on delete |
mov [ebx+APPDATA.state], TSTATE_RUNNING |
.task_found: |
mov [scheduler_current+ecx*4], ebx |
332,7 → 338,7 |
; the line below assumes APPDATA is 256 bytes long and SLOT_BASE is |
; aligned on 0x10000 |
mov byte [current_slot_idx], bh |
|
mov [TASK_BASE], edi |
rdtsc ;call _rdtsc |
mov [ebx-sizeof.APPDATA+APPDATA.counter_add], eax; for next using update_counters |
;mov [edi+TASKDATA.counter_add], eax; for next using update_counters |
346,6 → 352,7 |
cmp ecx, [esp] |
jb .priority_loop |
mov ebx, [current_slot] |
mov edi, [TASK_BASE] |
jmp .unlock_found |
endp |
|