提交 dd868974 创建 作者: rsc's avatar rsc

make wakeup1 static

上级 e0e7d07e
...@@ -55,7 +55,7 @@ growproc(int n) ...@@ -55,7 +55,7 @@ growproc(int n)
newmem = kalloc(cp->sz + n); newmem = kalloc(cp->sz + n);
if(newmem == 0) if(newmem == 0)
return 0xffffffff; return -1;
memmove(newmem, cp->mem, cp->sz); memmove(newmem, cp->mem, cp->sz);
memset(newmem + cp->sz, 0, n); memset(newmem + cp->sz, 0, n);
oldmem = cp->mem; oldmem = cp->mem;
...@@ -159,8 +159,10 @@ userinit(void) ...@@ -159,8 +159,10 @@ userinit(void)
p->mem = kalloc(p->sz); p->mem = kalloc(p->sz);
p->cwd = namei("/"); p->cwd = namei("/");
memset(p->tf, 0, sizeof(*p->tf)); memset(p->tf, 0, sizeof(*p->tf));
p->tf->es = p->tf->ds = p->tf->ss = (SEG_UDATA << 3) | DPL_USER;
p->tf->cs = (SEG_UCODE << 3) | DPL_USER; p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
p->tf->es = p->tf->ds;
p->tf->ss = p->tf->ds;
p->tf->eflags = FL_IF; p->tf->eflags = FL_IF;
p->tf->esp = p->sz; p->tf->esp = p->sz;
...@@ -168,6 +170,7 @@ userinit(void) ...@@ -168,6 +170,7 @@ userinit(void)
p->tf->esp -= 4; p->tf->esp -= 4;
*(uint*)(p->mem + p->tf->esp) = 0xefefefef; *(uint*)(p->mem + p->tf->esp) = 0xefefefef;
// On entry to user space, start executing at beginning of initcode.S.
p->tf->eip = 0; p->tf->eip = 0;
memmove(p->mem, _binary_initcode_start, (int)_binary_initcode_size); memmove(p->mem, _binary_initcode_start, (int)_binary_initcode_size);
safestrcpy(p->name, "initcode", sizeof(p->name)); safestrcpy(p->name, "initcode", sizeof(p->name));
...@@ -298,7 +301,7 @@ sleep(void *chan, struct spinlock *lk) ...@@ -298,7 +301,7 @@ sleep(void *chan, struct spinlock *lk)
//PAGEBREAK! //PAGEBREAK!
// Wake up all processes sleeping on chan. // Wake up all processes sleeping on chan.
// Proc_table_lock must be held. // Proc_table_lock must be held.
void static void
wakeup1(void *chan) wakeup1(void *chan)
{ {
struct proc *p; struct proc *p;
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论