]> Zhao Yanbai Git Server - kernel.git/commitdiff
删除do_fork里设置priority的测试逻辑;删除do_fork里的load_cr3逻辑
authoracevest <zhaoyanbai@126.com>
Wed, 3 Nov 2021 08:27:10 +0000 (16:27 +0800)
committeracevest <zhaoyanbai@126.com>
Wed, 3 Nov 2021 08:27:10 +0000 (16:27 +0800)
kernel/fork.c

index f5766abdd4ff9ab1af8359089049c55ac7183040..08fea395f2653db23ea2191d7fdbe29bda78ebb8 100644 (file)
@@ -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;
 }