We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92ed6a6 commit fc846fdCopy full SHA for fc846fd
os/src/batch.rs
@@ -142,10 +142,13 @@ pub fn run_next_app() -> ! {
142
// before this we have to drop local variables related to resources manually
143
// and release the resources
144
extern "C" {
145
- fn __restore(cx_addr: usize); //出栈
+ fn __restore(cx_addr: usize); // 声明外部函数__restore
146
}
147
+ // KERNEL_STACK.push_context压栈,应用启动所需的 “初始状态”(TrapContext)存入内核栈
148
+ // 返回上下文信息(应用启动所需的 “初始状态”)TrapContext::app_init_context
149
+ // _restore出栈恢复上下文,并跳转到用户态应用程序
150
unsafe {
- __restore(KERNEL_STACK.push_context(TrapContext::app_init_context( // 压栈
151
+ __restore(KERNEL_STACK.push_context(TrapContext::app_init_context(
152
APP_BASE_ADDRESS,
153
USER_STACK.get_sp(),
154
)) as *const _ as usize);
0 commit comments