提交 27ff8f0e 创建 作者: rsc's avatar rsc

compile fixes

上级 34295f46
...@@ -29,7 +29,6 @@ pinit(void) ...@@ -29,7 +29,6 @@ pinit(void)
static struct proc* static struct proc*
allocproc(void) allocproc(void)
{ {
int i;
struct proc *p; struct proc *p;
acquire(&ptable.lock); acquire(&ptable.lock);
...@@ -209,7 +208,6 @@ void ...@@ -209,7 +208,6 @@ void
scheduler(void) scheduler(void)
{ {
struct proc *p; struct proc *p;
int i;
for(;;){ for(;;){
// Enable interrupts on this processor, in lieu of saving intena. // Enable interrupts on this processor, in lieu of saving intena.
...@@ -327,7 +325,7 @@ wakeup1(void *chan) ...@@ -327,7 +325,7 @@ wakeup1(void *chan)
{ {
struct proc *p; struct proc *p;
for(p = proc; p < &proc[NPROC]; p++) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
if(p->state == SLEEPING && p->chan == chan) if(p->state == SLEEPING && p->chan == chan)
p->state = RUNNABLE; p->state = RUNNABLE;
} }
...@@ -414,7 +412,7 @@ int ...@@ -414,7 +412,7 @@ int
wait(void) wait(void)
{ {
struct proc *p; struct proc *p;
int i, havekids, pid; int havekids, pid;
acquire(&ptable.lock); acquire(&ptable.lock);
for(;;){ for(;;){
...@@ -465,7 +463,7 @@ procdump(void) ...@@ -465,7 +463,7 @@ procdump(void)
[RUNNING] "run ", [RUNNING] "run ",
[ZOMBIE] "zombie" [ZOMBIE] "zombie"
}; };
int i, j; int i;
struct proc *p; struct proc *p;
char *state; char *state;
uint pc[10]; uint pc[10];
...@@ -480,8 +478,8 @@ procdump(void) ...@@ -480,8 +478,8 @@ procdump(void)
cprintf("%d %s %s", p->pid, state, p->name); cprintf("%d %s %s", p->pid, state, p->name);
if(p->state == SLEEPING){ if(p->state == SLEEPING){
getcallerpcs((uint*)p->context->ebp+2, pc); getcallerpcs((uint*)p->context->ebp+2, pc);
for(j=0; j<10 && pc[j] != 0; j++) for(i=0; i<10 && pc[i] != 0; i++)
cprintf(" %p", pc[j]); cprintf(" %p", pc[i]);
} }
cprintf("\n"); cprintf("\n");
} }
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论