summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2017-01-31 17:47:16 -0500
committerFrans Kaashoek <[email protected]>2017-01-31 17:47:16 -0500
commitabf847a083888bbed4260ecacf849ea19f23e810 (patch)
tree4ae9b3487bbfe27f6382486bf877917dbb8bc030 /exec.c
parent59cdd6c63b89395d64ec9550181af5ed569b8466 (diff)
downloadxv6-labs-abf847a083888bbed4260ecacf849ea19f23e810.tar.gz
xv6-labs-abf847a083888bbed4260ecacf849ea19f23e810.tar.bz2
xv6-labs-abf847a083888bbed4260ecacf849ea19f23e810.zip
Start of an experiment to remove the use of gs for cpu local variables.
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/exec.c b/exec.c
index 4d7d97c..14d673f 100644
--- a/exec.c
+++ b/exec.c
@@ -22,6 +22,7 @@ exec(char *path, char **argv)
if((ip = namei(path)) == 0){
end_op();
+ cprintf("exec: fail\n");
return -1;
}
ilock(ip);
@@ -89,15 +90,15 @@ exec(char *path, char **argv)
for(last=s=path; *s; s++)
if(*s == '/')
last = s+1;
- safestrcpy(proc->name, last, sizeof(proc->name));
+ safestrcpy(myproc()->name, last, sizeof(myproc()->name));
// Commit to the user image.
- oldpgdir = proc->pgdir;
- proc->pgdir = pgdir;
- proc->sz = sz;
- proc->tf->eip = elf.entry; // main
- proc->tf->esp = sp;
- switchuvm(proc);
+ oldpgdir = myproc()->pgdir;
+ myproc()->pgdir = pgdir;
+ myproc()->sz = sz;
+ myproc()->tf->eip = elf.entry; // main
+ myproc()->tf->esp = sp;
+ switchuvm(myproc());
freevm(oldpgdir);
return 0;