rename p->tf to p->trapframe, for consistency with p->context

This commit is contained in:
Robert Morris 2020-07-17 16:29:52 -04:00 committed by Frans Kaashoek
parent 82981fab6b
commit 5494c91705
6 changed files with 30 additions and 30 deletions

View file

@ -106,7 +106,7 @@ found:
p->pid = allocpid();
// Allocate a trapframe page.
if((p->tf = (struct trapframe *)kalloc()) == 0){
if((p->trapframe = (struct trapframe *)kalloc()) == 0){
release(&p->lock);
return 0;
}
@ -129,9 +129,9 @@ found:
static void
freeproc(struct proc *p)
{
if(p->tf)
kfree((void*)p->tf);
p->tf = 0;
if(p->trapframe)
kfree((void*)p->trapframe);
p->trapframe = 0;
if(p->pagetable)
proc_freepagetable(p->pagetable, p->sz);
p->pagetable = 0;
@ -164,7 +164,7 @@ proc_pagetable(struct proc *p)
// map the trapframe just below TRAMPOLINE, for trampoline.S.
mappages(pagetable, TRAPFRAME, PGSIZE,
(uint64)(p->tf), PTE_R | PTE_W);
(uint64)(p->trapframe), PTE_R | PTE_W);
return pagetable;
}
@ -206,8 +206,8 @@ userinit(void)
p->sz = PGSIZE;
// prepare for the very first "return" from kernel to user.
p->tf->epc = 0; // user program counter
p->tf->sp = PGSIZE; // user stack pointer
p->trapframe->epc = 0; // user program counter
p->trapframe->sp = PGSIZE; // user stack pointer
safestrcpy(p->name, "initcode", sizeof(p->name));
p->cwd = namei("/");
@ -262,10 +262,10 @@ fork(void)
np->parent = p;
// copy saved user registers.
*(np->tf) = *(p->tf);
*(np->trapframe) = *(p->trapframe);
// Cause fork to return 0 in the child.
np->tf->a0 = 0;
np->trapframe->a0 = 0;
// increment reference counts on open file descriptors.
for(i = 0; i < NOFILE; i++)