Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc improvement: Fix register number in lab4 part5 #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/lab-4/guide/part-5.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 内核栈
4

### 为什么 / 怎么做

Expand Down Expand Up @@ -64,7 +64,7 @@ __interrupt:
# 交换 sp 和 sscratch(切换到内核栈)
csrrw sp, sscratch, sp
# 在内核栈开辟 Context 的空间
addi sp, sp, -36*8
addi sp, sp, -34*8

# 保存通用寄存器,除了 x0(固定为 0)
SAVE x1, 1
Expand Down Expand Up @@ -93,7 +93,7 @@ __restore:
csrw sstatus, t0
csrw sepc, t1
# 将内核栈地址写入 sscratch
addi t0, sp, 36*8
addi t0, sp, 34*8
csrw sscratch, t0

# 恢复通用寄存器
Expand Down