summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2019-07-24 10:39:05 -0400
committerRobert Morris <[email protected]>2019-07-24 10:39:05 -0400
commitb4f89bb5290cff5926e5a735487b024f8314e028 (patch)
tree5af3d92b47d18552a12343cf91fafacb48f43c01
parent8f6865d1f1b945aae1a7989798571de5382cf930 (diff)
downloadxv6-labs-b4f89bb5290cff5926e5a735487b024f8314e028.tar.gz
xv6-labs-b4f89bb5290cff5926e5a735487b024f8314e028.tar.bz2
xv6-labs-b4f89bb5290cff5926e5a735487b024f8314e028.zip
ping-pong exercise
-rw-r--r--kernel/trampoline.S10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/trampoline.S b/kernel/trampoline.S
index f067627..d4066c9 100644
--- a/kernel/trampoline.S
+++ b/kernel/trampoline.S
@@ -2,8 +2,8 @@
# code to switch between user and kernel space.
#
# this code is mapped at the same virtual address
- # in user and kernel space so that it can switch
- # page tables.
+ # in user and kernel space so that it continues
+ # to work when it switches page tables.
#
# kernel.ld causes trampout to be aligned
# to a page boundary.
@@ -18,7 +18,7 @@ trampout:
# a0: p->tf in user page table
# a1: new value for satp, for user page table
- # switch to user page table.
+ # switch to the user page table.
sfence.vma zero, zero
csrw satp, a1
@@ -59,11 +59,11 @@ trampout:
ld t5, 272(a0)
ld t6, 280(a0)
- # restore user a0, and save p->tf
+ # restore user a0, and save p->tf in sscratch
csrrw a0, sscratch, a0
# return to user mode and user pc.
- # caller has set up sstatus and sepc.
+ # usertrapret() set up sstatus and sepc.
sret
.align 4