diff --git a/os/src/x86_64/context.rs b/os/src/x86_64/context.rs index 686780f1..ba053574 100644 --- a/os/src/x86_64/context.rs +++ b/os/src/x86_64/context.rs @@ -238,7 +238,7 @@ pub async fn exec_app_context(proc_context: Box) -> Result (app_ctx.cpu.rsp, app_ctx.cpu.rip, app_ctx.as_mut_ptr()) }; // Push the ExecutionContext for the app to be used by return_to_app - let app_rsp = app_rsp + size_of::() as u64; + let app_rsp = app_rsp - size_of::() as u64; { let app_ctx = CONTEXT_APP.lock(); let app_ctx_on_app_stack = app_rsp as *mut ExecutionContext;