diff options
Diffstat (limited to 'common/tcb.c')
| -rw-r--r-- | common/tcb.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/common/tcb.c b/common/tcb.c index ef15788..fb2f934 100644 --- a/common/tcb.c +++ b/common/tcb.c @@ -435,7 +435,7 @@ struct call_ctx { id_t pid; }; -void save_context(struct tcb *t) +void enter_rpc(struct tcb *t) { vm_t rpc_stack = t->rpc_stack; if (is_rpc(t)) @@ -447,6 +447,10 @@ void save_context(struct tcb *t) rpc_stack = align_down(get_stack(t), BASE_PAGE_SIZE); + /* make sure updates are visible when swapping to the new virtual memory */ + mark_rpc_inaccessible(t, rpc_stack, t->rpc_stack); + use_vmem(t->rpc.vmem); + struct call_ctx *ctx = (struct call_ctx *)(rpc_stack) - 1; ctx->exec = t->exec; ctx->pid = t->pid; @@ -468,12 +472,12 @@ void save_context(struct tcb *t) * we'll handle it separately and if the process isn't going over the * limit just give it more. * */ - mark_rpc_inaccessible(t, rpc_stack, t->rpc_stack); t->rpc_stack = rpc_stack; t->regs = (vm_t)ctx; + set_stack(t, rpc_stack); } -void load_context(struct tcb *t) +void leave_rpc(struct tcb *t) { vm_t rpc_stack = t->rpc_stack + BASE_PAGE_SIZE; struct call_ctx *ctx = (struct call_ctx *)(rpc_stack) - 1; |
