summaryrefslogtreecommitdiff
path: root/sysfile.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 /sysfile.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 'sysfile.c')
-rw-r--r--sysfile.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sysfile.c b/sysfile.c
index 98e8c43..fae6960 100644
--- a/sysfile.c
+++ b/sysfile.c
@@ -26,7 +26,7 @@ argfd(int n, int *pfd, struct file **pf)
if(argint(n, &fd) < 0)
return -1;
- if(fd < 0 || fd >= NOFILE || (f=proc->ofile[fd]) == 0)
+ if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0)
return -1;
if(pfd)
*pfd = fd;
@@ -43,8 +43,8 @@ fdalloc(struct file *f)
int fd;
for(fd = 0; fd < NOFILE; fd++){
- if(proc->ofile[fd] == 0){
- proc->ofile[fd] = f;
+ if(myproc()->ofile[fd] == 0){
+ myproc()->ofile[fd] = f;
return fd;
}
}
@@ -97,7 +97,7 @@ sys_close(void)
if(argfd(0, &fd, &f) < 0)
return -1;
- proc->ofile[fd] = 0;
+ myproc()->ofile[fd] = 0;
fileclose(f);
return 0;
}
@@ -386,9 +386,9 @@ sys_chdir(void)
return -1;
}
iunlock(ip);
- iput(proc->cwd);
+ iput(myproc()->cwd);
end_op();
- proc->cwd = ip;
+ myproc()->cwd = ip;
return 0;
}
@@ -432,7 +432,7 @@ sys_pipe(void)
fd0 = -1;
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
if(fd0 >= 0)
- proc->ofile[fd0] = 0;
+ myproc()->ofile[fd0] = 0;
fileclose(rf);
fileclose(wf);
return -1;