You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stvec: The kernel writes the address of its trap handler here; the RISC-V jumps here to handle a trap.
sepc: When a trap occurs, RISC-V saves the program counter here (since the pc is then overwritten with stvec). The sret (return from trap) instruction copies sepc to the pc. The kernel can write to sepc to control where sret goes.
9.4对stvec的描述:“STVEC寄存器,它会保存当trap,page fault或者中断发生时,CPU运行的用户程序的程序计数器,这样才能在稍后恢复程序的运行。”
保存触发trap的用户指令的地址好像是SEPC寄存器。STVEC寄存器应该是保存trap handler(uservec、kernelvec)的地址。trap返回时,恢复PC用的应该是SEPC的值吧。
The text was updated successfully, but these errors were encountered: