assorted fixes:
* rename c/cp to cpu/proc * rename cpu.context to cpu.scheduler * fix some comments * formatting for printout
This commit is contained in:
parent
0aef891495
commit
48755214c9
23 changed files with 2437 additions and 2379 deletions
18
sysfile.c
18
sysfile.c
|
|
@ -18,7 +18,7 @@ argfd(int n, int *pfd, struct file **pf)
|
|||
|
||||
if(argint(n, &fd) < 0)
|
||||
return -1;
|
||||
if(fd < 0 || fd >= NOFILE || (f=cp->ofile[fd]) == 0)
|
||||
if(fd < 0 || fd >= NOFILE || (f=proc->ofile[fd]) == 0)
|
||||
return -1;
|
||||
if(pfd)
|
||||
*pfd = fd;
|
||||
|
|
@ -35,8 +35,8 @@ fdalloc(struct file *f)
|
|||
int fd;
|
||||
|
||||
for(fd = 0; fd < NOFILE; fd++){
|
||||
if(cp->ofile[fd] == 0){
|
||||
cp->ofile[fd] = f;
|
||||
if(proc->ofile[fd] == 0){
|
||||
proc->ofile[fd] = f;
|
||||
return fd;
|
||||
}
|
||||
}
|
||||
|
|
@ -89,7 +89,7 @@ sys_close(void)
|
|||
|
||||
if(argfd(0, &fd, &f) < 0)
|
||||
return -1;
|
||||
cp->ofile[fd] = 0;
|
||||
proc->ofile[fd] = 0;
|
||||
fileclose(f);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -338,8 +338,8 @@ sys_chdir(void)
|
|||
return -1;
|
||||
}
|
||||
iunlock(ip);
|
||||
iput(cp->cwd);
|
||||
cp->cwd = ip;
|
||||
iput(proc->cwd);
|
||||
proc->cwd = ip;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -356,13 +356,13 @@ sys_exec(void)
|
|||
for(i=0;; i++){
|
||||
if(i >= NELEM(argv))
|
||||
return -1;
|
||||
if(fetchint(cp, uargv+4*i, (int*)&uarg) < 0)
|
||||
if(fetchint(proc, uargv+4*i, (int*)&uarg) < 0)
|
||||
return -1;
|
||||
if(uarg == 0){
|
||||
argv[i] = 0;
|
||||
break;
|
||||
}
|
||||
if(fetchstr(cp, uarg, &argv[i]) < 0)
|
||||
if(fetchstr(proc, uarg, &argv[i]) < 0)
|
||||
return -1;
|
||||
}
|
||||
return exec(path, argv);
|
||||
|
|
@ -382,7 +382,7 @@ sys_pipe(void)
|
|||
fd0 = -1;
|
||||
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
|
||||
if(fd0 >= 0)
|
||||
cp->ofile[fd0] = 0;
|
||||
proc->ofile[fd0] = 0;
|
||||
fileclose(rf);
|
||||
fileclose(wf);
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue