From ec989bbe7d9bb7a844eeddeceaeb7bb7e4d5dab6 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 21 Oct 2022 17:43:31 +0300 Subject: initial implementation of swap + Slightly unsure if it should be a syscall, or if assign would be enough. Also, which thread should run in a fork/spawn? For now, old thread, though this might increase latency. Or add swap flag to these calls? --- common/tcb.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'common/tcb.c') diff --git a/common/tcb.c b/common/tcb.c index f618cd6..42e634d 100644 --- a/common/tcb.c +++ b/common/tcb.c @@ -305,9 +305,13 @@ struct tcb *cur_proc() void use_tcb(struct tcb *t) { + cpu_assign(t); + id_t cpu = cpu_id(); t->cpu_id = cpu; cpu_tcb[cpu] = t; + + use_vmem(t->proc.vmem); } struct tcb *get_tcb(id_t tid) -- cgit v1.3