diff options
author | rsc <rsc> | 2007-08-24 20:22:55 +0000 |
---|---|---|
committer | rsc <rsc> | 2007-08-24 20:22:55 +0000 |
commit | dd8689743404e31dc227a4f8ccff1b6d756dfee9 (patch) | |
tree | b3d0a4b6d644ad02412ed5f951e4ca3ea15d2915 | |
parent | e0e7d07e5afc1a073b659cbf0b8594071f05a816 (diff) | |
download | xv6-labs-dd8689743404e31dc227a4f8ccff1b6d756dfee9.tar.gz xv6-labs-dd8689743404e31dc227a4f8ccff1b6d756dfee9.tar.bz2 xv6-labs-dd8689743404e31dc227a4f8ccff1b6d756dfee9.zip |
make wakeup1 static
-rw-r--r-- | proc.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -55,7 +55,7 @@ growproc(int n) newmem = kalloc(cp->sz + n); if(newmem == 0) - return 0xffffffff; + return -1; memmove(newmem, cp->mem, cp->sz); memset(newmem + cp->sz, 0, n); oldmem = cp->mem; @@ -159,8 +159,10 @@ userinit(void) p->mem = kalloc(p->sz); p->cwd = namei("/"); 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->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->esp = p->sz; @@ -168,6 +170,7 @@ userinit(void) p->tf->esp -= 4; *(uint*)(p->mem + p->tf->esp) = 0xefefefef; + // On entry to user space, start executing at beginning of initcode.S. p->tf->eip = 0; memmove(p->mem, _binary_initcode_start, (int)_binary_initcode_size); safestrcpy(p->name, "initcode", sizeof(p->name)); @@ -298,7 +301,7 @@ sleep(void *chan, struct spinlock *lk) //PAGEBREAK! // Wake up all processes sleeping on chan. // Proc_table_lock must be held. -void +static void wakeup1(void *chan) { struct proc *p; |