From: acevest Date: Wed, 3 Nov 2021 08:27:10 +0000 (+0800) Subject: 删除do_fork里设置priority的测试逻辑;删除do_fork里的load_cr3逻辑 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/static/doc/zpipe.c?a=commitdiff_plain;h=ef92987e1a715081fc5b4f75be2072c4d6bd7e08;p=kernel.git 删除do_fork里设置priority的测试逻辑;删除do_fork里的load_cr3逻辑 --- diff --git a/kernel/fork.c b/kernel/fork.c index f5766ab..08fea39 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -30,9 +30,7 @@ int do_fork(pt_regs_t *regs, unsigned long flags) { } memcpy(tsk, current, sizeof(task_union)); - tsk->priority = 61; - //{ tsk->cr3 = (unsigned long)alloc_one_page(0); assert(tsk->cr3 != 0); @@ -80,9 +78,6 @@ int do_fork(pt_regs_t *regs, unsigned long flags) { page->count++; } } - //} - - load_cr3(current); tsk->pid = get_next_pid(); tsk->ppid = current->pid; @@ -98,7 +93,6 @@ int do_fork(pt_regs_t *regs, unsigned long flags) { tsk->esp0 = TASK_SIZE + (unsigned long)tsk; tsk->esp = (unsigned long)child_regs; tsk->eip = (unsigned long)ret_from_fork_user; - if (flags & FORK_KRNL) { tsk->eip = (unsigned long)ret_from_fork_krnl; } @@ -109,7 +103,6 @@ int do_fork(pt_regs_t *regs, unsigned long flags) { tsk->weight = TASK_INIT_WEIGHT; INIT_LIST_HEAD(&tsk->list); - unsigned long iflags; irq_save(iflags); list_add(&tsk->list, &all_tasks); @@ -117,7 +110,5 @@ int do_fork(pt_regs_t *regs, unsigned long flags) { tsk->state = TASK_RUNNING; - printk("%s:%d\n", __func__, __LINE__); - return (int)tsk->pid; }