summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorrtm <rtm>2006-08-29 19:06:37 +0000
committerrtm <rtm>2006-08-29 19:06:37 +0000
commitdfcc5b997ce9c313b9ac0e7d8da39c4416b472a8 (patch)
tree2d6c4e47bad6cfe7436896068a5872ace545a974 /proc.c
parentd7ce6545e7179e9a4b950838c354b485e3f3fdb8 (diff)
downloadxv6-labs-dfcc5b997ce9c313b9ac0e7d8da39c4416b472a8.tar.gz
xv6-labs-dfcc5b997ce9c313b9ac0e7d8da39c4416b472a8.tar.bz2
xv6-labs-dfcc5b997ce9c313b9ac0e7d8da39c4416b472a8.zip
prune unneeded panics and debug output
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/proc.c b/proc.c
index 1d0917f..01f6aa4 100644
--- a/proc.c
+++ b/proc.c
@@ -169,18 +169,11 @@ scheduler(void)
struct proc *p;
int i;
- if(cpus[cpu()].nlock != 0){
- cprintf("la %x lr %x\n", cpus[cpu()].lastacquire, cpus[cpu()].lastrelease );
- panic("holding locks at first entry to scheduler");
- }
-
for(;;){
// Loop over process table looking for process to run.
acquire(&proc_table_lock);
+
for(i = 0; i < NPROC; i++){
- if(cpus[cpu()].guard1 != 0xdeadbeef ||
- cpus[cpu()].guard2 != 0xdeadbeef)
- panic("cpu guard");
p = &proc[i];
if(p->state != RUNNABLE)
continue;
@@ -198,31 +191,11 @@ scheduler(void)
// Process is done running for now.
// It should have changed its p->state before coming back.
curproc[cpu()] = 0;
- if(p->state == RUNNING)
- panic("swtch to scheduler with state=RUNNING");
- if(!holding(&proc_table_lock)){
- cprintf("back to scheduler without proc_table_lock (pid=%d state=%d)", p->pid, p->state);
- panic("scheduler lock");
- }
- if(cpus[cpu()].nlock != 1){
- cprintf("holding %d locks in scheduler (pid=%d state=%d)\n", cpus[cpu()].nlock, p->pid, p->state);
- panic("scheduler lock");
- }
-
setupsegs(0);
}
release(&proc_table_lock);
-
- if(cpus[cpu()].nlock != 0)
- panic("holding locks in scheduler");
-
- // With proc_table_lock released, there are no
- // locks held on this cpu, so interrupts are enabled.
- // Hardware interrupts can happen here.
- // Also, releasing the lock here lets the other CPUs
- // look for runnable processes too.
}
}