From 54e6f829e4019e10734588b9ba63c2c186c94f8e Mon Sep 17 00:00:00 2001 From: Frans Kaashoek Date: Tue, 9 Oct 2018 14:28:54 -0400 Subject: Separate system call path from trap path. Passes usertests on 1 and 2 cpus. --- exec.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'exec.c') diff --git a/exec.c b/exec.c index b1a9229..743437a 100644 --- a/exec.c +++ b/exec.c @@ -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; -- cgit v1.2.3