Start of an experiment to remove the use of gs for cpu local variables.
This commit is contained in:
parent
59cdd6c63b
commit
abf847a083
17 changed files with 145 additions and 123 deletions
15
exec.c
15
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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue