Rev 421 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 421 | Rev 427 | ||
---|---|---|---|
Line 235... | Line 235... | ||
235 | add edi,0x20 |
235 | add edi,0x20 |
236 | dec ecx |
236 | dec ecx |
237 | jnz .newupdate |
237 | jnz .newupdate |
Line 238... | Line 238... | ||
238 | 238 | ||
- | 239 | ret |
|
- | 240 | ||
- | 241 | if 0 |
|
- | 242 | ||
- | 243 | MAX_PROIRITY 0 ; highest, used for kernel tasks |
|
- | 244 | MAX_USER_PRIORITY 0 ; highest priority for user processes |
|
- | 245 | USER_PRIORITY 7 ; default (should correspond to nice 0) |
|
- | 246 | MIN_USER_PRIORITY 14 ; minimum priority for user processes |
|
- | 247 | IDLE_PRIORITY 15 ; lowest, only IDLE process goes here |
|
- | 248 | NR_SCHED_QUEUES 16 ; MUST equal IDLE_PRIORYTY + 1 |
|
- | 249 | ||
- | 250 | rdy_head rd 16 |
|
- | 251 | ||
- | 252 | ||
- | 253 | align 4 |
|
- | 254 | pick_task: |
|
- | 255 | ||
- | 256 | xor eax, eax |
|
- | 257 | .pick: |
|
- | 258 | mov ebx, [rdy_head+eax*4] |
|
- | 259 | test ebx, ebx |
|
- | 260 | jz .next |
|
- | 261 | ||
- | 262 | mov [next_task], ebx |
|
- | 263 | test [ebx+flags.billable] |
|
- | 264 | jz @F |
|
- | 265 | mov [bill_task], ebx |
|
- | 266 | @@: |
|
- | 267 | ret |
|
- | 268 | .next: |
|
- | 269 | inc eax |
|
- | 270 | jmp .pick |
|
- | 271 | ||
- | 272 | ||
- | 273 | ; param |
|
- | 274 | ; eax= task |
|
- | 275 | ; |
|
- | 276 | ; retval |
|
- | 277 | ; eax= task |
|
- | 278 | ; ebx= queue |
|
- | 279 | ; ecx= front if 1 or back if 0 |
|
- | 280 | ||
- | 281 | align 4 |
|
- | 282 | shed: |
|
- | 283 | cmp [eax+.tics_left], 0 ;signed compare |
|
- | 284 | mov ebx, [eax+.priority] |
|
- | 285 | setg ecx |
|
- | 286 | jg @F |
|
- | 287 | ||
- | 288 | mov edx, [eax+.tics_quantum] |
|
- | 289 | mov [eax+.ticks_left], edx |
|
- | 290 | cmp ebx, (IDLE_PRIORITY-1) |
|
- | 291 | je @F |
|
- | 292 | inc ebx |
|
- | 293 | @@: |
|
- | 294 | ret |
|
- | 295 | ||
- | 296 | ; param |
|
- | 297 | ; eax= task |
|
- | 298 | ||
- | 299 | align 4 |
|
- | 300 | enqueue: |
|
- | 301 | call shed ;eax |
|
- | 302 | cmp [rdy_head+ebx*4],0 |
|
- | 303 | jnz @F |
|
- | 304 | ||
- | 305 | mov [rdy_head+ebx*4], eax |
|
- | 306 | mov [rdy_tail+ebx*4], eax |
|
- | 307 | mov [eax+.next_ready], 0 |
|
- | 308 | jmp .pick |
|
- | 309 | @@: |
|
- | 310 | test ecx, ecx |
|
- | 311 | jz .back |
|
- | 312 | ||
- | 313 | mov ecx, [rdy_head+ebx*4] |
|
- | 314 | mov [eax+.next_ready], ecx |
|
- | 315 | mov [rdy_head+ebx*4], eax |
|
- | 316 | jmp .pick |
|
- | 317 | .back: |
|
- | 318 | mov ecx, [rdy_tail+ebx*4] |
|
- | 319 | mov [ecx+.next_ready], eax |
|
- | 320 | mov [rdy_tail+ebx*4], eax |
|
- | 321 | mov [eax+.next_ready], 0 |
|
- | 322 | .pick: |
|
- | 323 | call pick_proc ;select next task |
|
- | 324 | ret |
|
- | 325 | ||
- | 326 | end if---><---><<---> |