diff options
author | Robert Morris <[email protected]> | 2020-07-17 16:29:52 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2020-08-10 11:19:10 -0400 |
commit | 5494c9170587b17c9d749e19753fa3e7fb6958b9 (patch) | |
tree | 610285e7a543272daaea525dd3eeada3ce7e6735 /kernel/trap.c | |
parent | 82981fab6bbd36dc0ff24201a11d365c4a2c6b1d (diff) | |
download | xv6-labs-5494c9170587b17c9d749e19753fa3e7fb6958b9.tar.gz xv6-labs-5494c9170587b17c9d749e19753fa3e7fb6958b9.tar.bz2 xv6-labs-5494c9170587b17c9d749e19753fa3e7fb6958b9.zip |
rename p->tf to p->trapframe, for consistency with p->context
Diffstat (limited to 'kernel/trap.c')
-rw-r--r-- | kernel/trap.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/kernel/trap.c b/kernel/trap.c index 5e11e4b..77ff868 100644 --- a/kernel/trap.c +++ b/kernel/trap.c @@ -48,7 +48,7 @@ usertrap(void) struct proc *p = myproc(); // save user program counter. - p->tf->epc = r_sepc(); + p->trapframe->epc = r_sepc(); if(r_scause() == 8){ // system call @@ -58,7 +58,7 @@ usertrap(void) // sepc points to the ecall instruction, // but we want to return to the next instruction. - p->tf->epc += 4; + p->trapframe->epc += 4; // an interrupt will change sstatus &c registers, // so don't enable until done with those registers. @@ -100,10 +100,10 @@ usertrapret(void) // set up trapframe values that uservec will need when // the process next re-enters the kernel. - p->tf->kernel_satp = r_satp(); // kernel page table - p->tf->kernel_sp = p->kstack + PGSIZE; // process's kernel stack - p->tf->kernel_trap = (uint64)usertrap; - p->tf->kernel_hartid = r_tp(); // hartid for cpuid() + p->trapframe->kernel_satp = r_satp(); // kernel page table + p->trapframe->kernel_sp = p->kstack + PGSIZE; // process's kernel stack + p->trapframe->kernel_trap = (uint64)usertrap; + p->trapframe->kernel_hartid = r_tp(); // hartid for cpuid() // set up the registers that trampoline.S's sret will use // to get to user space. @@ -115,7 +115,7 @@ usertrapret(void) w_sstatus(x); // set S Exception Program Counter to the saved user pc. - w_sepc(p->tf->epc); + w_sepc(p->trapframe->epc); // tell trampoline.S the user page table to switch to. uint64 satp = MAKE_SATP(p->pagetable); |