ret_val = -EINVAL;
if(proc && pd) {
+ u32_t pdbr;
+ u32_t kstack;
int i;
/* FIXME: make sure none of the tasks are running */
proc->p_pgdir = pd;
+ pdbr = (u32_t)pg_dir_get_pdbr(pd);
+ kstack = (u32_t)pg_dir_get_kstack(pd);
+
/* FIXME: Set t_pgdir in all tasks */
for(i = 0; i < CONFIG_PROC_MAXTASKS; i++) {
if(proc->p_tasks[i]) {
- proc->p_tasks[i]->t_pgdir = (u32_t)pg_dir_get_pdbr(pd);
+ proc->p_tasks[i]->t_pgdir = pdbr;
+ /*
+ * FIXME: Allocate separate stacks for each task
+ *
+ * The only reason this is not catching fire right
+ * away is that there is no threading yet. This *WILL*
+ * break once pthreads are implemented.
+ */
+ proc->p_tasks[i]->t_kstack = kstack;
}
}