diff options
author | Frans Kaashoek <[email protected]> | 2018-10-09 14:28:54 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2018-10-09 14:28:54 -0400 |
commit | 54e6f829e4019e10734588b9ba63c2c186c94f8e (patch) | |
tree | c4fae7ef568183e9566d69fb6f563c218c12819b /exec.c | |
parent | f241e67d911d790376de26698f8bf8ba02550212 (diff) | |
download | xv6-labs-54e6f829e4019e10734588b9ba63c2c186c94f8e.tar.gz xv6-labs-54e6f829e4019e10734588b9ba63c2c186c94f8e.tar.bz2 xv6-labs-54e6f829e4019e10734588b9ba63c2c186c94f8e.zip |
Separate system call path from trap path. Passes usertests on 1 and 2 cpus.
Diffstat (limited to 'exec.c')
-rw-r--r-- | exec.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -85,8 +85,8 @@ exec(char *path, char **argv) ustack[1] = argc; ustack[2] = sp - (argc+1)*sizeof(uint64); // argv pointer - curproc->tf->rdi = argc; - curproc->tf->rsi = sp - (argc+1)*sizeof(uint64); + curproc->sf->rdi = argc; + curproc->sf->rsi = sp - (argc+1)*sizeof(uint64); sp -= (3+argc+1) * sizeof(uint64); if(copyout(pgdir, sp, ustack, (3+argc+1)*sizeof(uint64)) < 0) @@ -102,9 +102,8 @@ exec(char *path, char **argv) oldpgdir = curproc->pgdir; curproc->pgdir = pgdir; curproc->sz = sz; - curproc->tf->rip = elf.entry; // main - curproc->tf->rcx = elf.entry; - curproc->tf->rsp = sp; + curproc->sf->rcx = elf.entry; // main + curproc->sf->rsp = sp; switchuvm(curproc); freevm(oldpgdir, oldsz); return 0; |