aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/proc.c2
-rw-r--r--common/tcb.c7
-rw-r--r--common/uapi/dispatch.c1
3 files changed, 6 insertions, 4 deletions
diff --git a/common/proc.c b/common/proc.c
index 9d74a86..001e127 100644
--- a/common/proc.c
+++ b/common/proc.c
@@ -18,7 +18,7 @@ stat_t prepare_proc(struct tcb *t, vm_t bin, vm_t interp)
return ERR_INVAL;
alloc_stacks(t);
- set_thread(t, t->thread_stack_top);
+ set_thread(t);
set_return(entry);
return OK;
}
diff --git a/common/tcb.c b/common/tcb.c
index 3f644c1..a31ac87 100644
--- a/common/tcb.c
+++ b/common/tcb.c
@@ -129,9 +129,9 @@ struct tcb *create_thread(struct tcb *p)
return t;
}
-static stat_t __clone_proc(struct tcb *p, struct tcb *n)
+static stat_t __copy_proc(struct tcb *p, struct tcb *n)
{
- /** \todo clone memory regions, and mark them MR_COW, as well as copy
+ /** \todo Copy memory regions, and mark them MR_COW, as well as copy
* bm_branch tree but with VM_W off, also at some point write COW
* handler */
return OK;
@@ -147,7 +147,7 @@ struct tcb *create_proc(struct tcb *p)
return 0;
if (likely(p))
- __clone_proc(p, n); /* we have a parent thread */
+ __copy_proc(p, n); /* we have a parent thread */
return n;
}
@@ -239,6 +239,7 @@ struct tcb *cur_proc()
void use_tcb(struct tcb *t)
{
+ t->cpu_id = cpu_id();
cpu_tcb[cpu_id()] = t;
}
diff --git a/common/uapi/dispatch.c b/common/uapi/dispatch.c
index 35c39c9..848fc3f 100644
--- a/common/uapi/dispatch.c
+++ b/common/uapi/dispatch.c
@@ -48,6 +48,7 @@ SYSCALL_DEFINE0(noop)(){
struct sys_ret syscall_dispatch(sys_arg_t syscall, sys_arg_t a, sys_arg_t b,
sys_arg_t c, sys_arg_t d)
{
+ /** \todo Add check that syscall is not larger than table */
sys_t call = syscall_table[syscall];
if (!call)