Repos / kernel.git / commitdiff
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0192fe4)
raw | patch | inline | side by side (parent: 0192fe4)
| author | zhaoyanbai <zhaoyanbai@126.com> | |
| Fri, 29 Oct 2021 02:00:43 +0000 (10:00 +0800) | ||
| committer | zhaoyanbai <zhaoyanbai@126.com> | |
| Wed, 3 Nov 2021 02:45:43 +0000 (10:45 +0800) |
| kernel/sched.c | patch | blob | history |
diff --git a/kernel/sched.c b/kernel/sched.c
--- a/kernel/sched.c
+++ b/kernel/sched.c
//for(i=0; i<NR_OPENS; i++)
// root_task.fps[i] = 0;
- tss.esp0 = ((unsigned long)&root_task) + sizeof(root_task);
- root_task.esp0 = tss.esp0;
+ root_task.esp0 = ((unsigned long)&root_task) + sizeof(root_task);
root_task.cr3 = (unsigned long)init_pgd;
+ tss.esp0 = root_task.esp0;
+
printk("init_root_task tss.esp0 %08x\n", tss.esp0);
}
return 0;
}
-void set_esp0(task_union * tsk)
-{
- tss.esp0 = tsk->esp0;
-}
void switch_to()
{
LOAD_CR3(current->cr3);
- set_esp0(current);
+ tss.esp0 = current->esp0;
}
void context_switch(task_union * prev, task_union * next)