diff options
author | Frans Kaashoek <[email protected]> | 2019-07-08 15:50:06 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2019-07-08 15:50:06 -0400 |
commit | 2f22a3ed6a8dbdd4dcfb2c0a43dc854a36a59cfc (patch) | |
tree | 189387b82cfd998170d39dfc998de0fc86602544 /kernel/exec.c | |
parent | 75b0c6fc91c1264aaa5d080d9faeb87c90d02ad3 (diff) | |
parent | 60ed537427c31d320ca4c8778d21d13304285b00 (diff) | |
download | xv6-labs-2f22a3ed6a8dbdd4dcfb2c0a43dc854a36a59cfc.tar.gz xv6-labs-2f22a3ed6a8dbdd4dcfb2c0a43dc854a36a59cfc.tar.bz2 xv6-labs-2f22a3ed6a8dbdd4dcfb2c0a43dc854a36a59cfc.zip |
Merge branch 'riscv-proc' into riscv
Diffstat (limited to 'kernel/exec.c')
-rw-r--r-- | kernel/exec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/exec.c b/kernel/exec.c index c9af395..b21afbb 100644 --- a/kernel/exec.c +++ b/kernel/exec.c @@ -2,6 +2,7 @@ #include "param.h" #include "memlayout.h" #include "riscv.h" +#include "spinlock.h" #include "proc.h" #include "defs.h" #include "elf.h" @@ -19,7 +20,6 @@ exec(char *path, char **argv) struct proghdr ph; pagetable_t pagetable = 0, oldpagetable; struct proc *p = myproc(); - uint64 oldsz = p->sz; begin_op(); @@ -60,6 +60,9 @@ exec(char *path, char **argv) end_op(); ip = 0; + p = myproc(); + uint64 oldsz = p->sz; + // Allocate two pages at the next page boundary. // Use the second as the user stack. sz = PGROUNDUP(sz); |