Mercurial > hg > Members > innparusu > xv6-rpi
comparison src/proc.c @ 28:68de775c3a29
add cbc_sched
author | mir3636 |
---|---|
date | Fri, 18 Jan 2019 09:40:22 +0900 |
parents | 36bd61f5c847 |
children | 96af12a50fdb |
comparison
equal
deleted
inserted
replaced
27:1a64b5645cdd | 28:68de775c3a29 |
---|---|
351 | 351 |
352 release(&ptable.lock); | 352 release(&ptable.lock); |
353 } | 353 } |
354 } | 354 } |
355 | 355 |
356 __code cbc_sched(__code(*next)()) | |
357 { | |
358 int intena; | |
359 | |
360 if(!holding(&ptable.lock)) { | |
361 panic("sched ptable.lock"); | |
362 } | |
363 | |
364 if(cpu->ncli != 1) { | |
365 panic("sched locks"); | |
366 } | |
367 | |
368 if(proc->state == RUNNING) { | |
369 panic("sched running"); | |
370 } | |
371 | |
372 if(int_enabled ()) { | |
373 panic("sched interruptible"); | |
374 } | |
375 | |
376 intena = cpu->intena; | |
377 swtch(&proc->context, cpu->scheduler); | |
378 cpu->intena = intena; | |
379 | |
380 goto next(); | |
381 } | |
382 | |
383 | |
356 // Enter scheduler. Must hold only ptable.lock | 384 // Enter scheduler. Must hold only ptable.lock |
357 // and have changed proc->state. | 385 // and have changed proc->state. |
358 void sched(void) | 386 void sched(void) |
359 { | 387 { |
360 int intena; | 388 int intena; |