From dfcc5b997ce9c313b9ac0e7d8da39c4416b472a8 Mon Sep 17 00:00:00 2001 From: rtm Date: Tue, 29 Aug 2006 19:06:37 +0000 Subject: prune unneeded panics and debug output --- proc.c | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'proc.c') 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. } } -- cgit v1.2.3