From ef92987e1a715081fc5b4f75be2072c4d6bd7e08 Mon Sep 17 00:00:00 2001 From: acevest Date: Wed, 3 Nov 2021 16:27:10 +0800 Subject: [PATCH] =?utf8?q?=E5=88=A0=E9=99=A4do=5Ffork=E9=87=8C=E8=AE=BE?= =?utf8?q?=E7=BD=AEpriority=E7=9A=84=E6=B5=8B=E8=AF=95=E9=80=BB=E8=BE=91;?= =?utf8?q?=E5=88=A0=E9=99=A4do=5Ffork=E9=87=8C=E7=9A=84load=5Fcr3=E9=80=BB?= =?utf8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- kernel/fork.c | 9 --------- 1 file changed, 9 deletions(-) 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; } -- 2.44.0