将当前的sched_cfs函数做一个包裹,套一层sched(). (#32)

* 将当前的sched_cfs函数做一个包裹,套一层sched().

* 用sched()包裹sched_cfs(),用sched_enqueue()包裹sched_cfs_enqueue()

* 用sched()包裹sched_cfs(),用sched_enqueue()包裹sched_cfs_enqueue(),并替换

* bugfix: 修正拼写错误导致的编译错误

* 修正拼写错误

Co-authored-by: fslongjin <longjin@RinGoTek.cn>
This commit is contained in:
houmkh
2022-08-31 07:59:31 +08:00
committed by GitHub
parent 8bc8890070
commit 1a2d405384
10 changed files with 59 additions and 28 deletions

View File

@ -12,7 +12,7 @@ void do_divide_error(struct pt_regs *regs, unsigned long error_code)
kerror("do_divide_error(0),\tError Code:%#18lx,\tRSP:%#18lx,\tRIP:%#18lx\t CPU:%d\t pid=%d\n", error_code, regs->rsp, regs->rip, proc_current_cpu_id, current_pcb->pid);
traceback(regs);
current_pcb->state = PROC_STOPPED;
sched_cfs();
sched();
}
// 1 #DB 调试异常
@ -59,7 +59,7 @@ void do_overflow(struct pt_regs *regs, unsigned long error_code)
printk(" ] do_overflow(4),\tError Code:%#18lx,\tRSP:%#18lx,\tRIP:%#18lx\t CPU:%d\n", error_code, regs->rsp, regs->rip, proc_current_cpu_id);
current_pcb->state = PROC_STOPPED;
sched_cfs();
sched();
}
// 5 #BR 越界异常
@ -79,7 +79,7 @@ void do_undefined_opcode(struct pt_regs *regs, unsigned long error_code)
kerror("do_undefined_opcode(6),\tError Code:%#18lx,\tRSP:%#18lx,\tRIP:%#18lx\t CPU:%d, pid:%ld", error_code, regs->rsp, regs->rip, proc_current_cpu_id, current_pcb->pid);
traceback(regs);
current_pcb->state = PROC_STOPPED;
sched_cfs();
sched();
}
// 7 #NM 设备异常FPU不存在
@ -89,7 +89,7 @@ void do_dev_not_avaliable(struct pt_regs *regs, unsigned long error_code)
kerror("do_dev_not_avaliable(7),\tError Code:%#18lx,\tRSP:%#18lx,\tRIP:%#18lx\t CPU:%d\n", error_code, regs->rsp, regs->rip, proc_current_cpu_id);
current_pcb->state = PROC_STOPPED;
sched_cfs();
sched();
}
// 8 #DF 双重错误
@ -101,7 +101,7 @@ void do_double_fault(struct pt_regs *regs, unsigned long error_code)
printk(" ] do_double_fault(8),\tError Code:%#18lx,\tRSP:%#18lx,\tRIP:%#18lx\t CPU:%d\n", error_code, regs->rsp, regs->rip, proc_current_cpu_id);
traceback(regs);
current_pcb->state = PROC_STOPPED;
sched_cfs();
sched();
}
// 9 协处理器越界(保留)
@ -111,7 +111,7 @@ void do_coprocessor_segment_overrun(struct pt_regs *regs, unsigned long error_co
kerror("do_coprocessor_segment_overrun(9),\tError Code:%#18lx,\tRSP:%#18lx,\tRIP:%#18lx\t CPU:%d\n", error_code, regs->rsp, regs->rip, proc_current_cpu_id);
current_pcb->state = PROC_STOPPED;
sched_cfs();
sched();
}
// 10 #TS 无效的TSS段
@ -142,7 +142,7 @@ void do_invalid_TSS(struct pt_regs *regs, unsigned long error_code)
printk("\n");
current_pcb->state = PROC_STOPPED;
sched_cfs();
sched();
}
// 11 #NP 段不存在
@ -152,7 +152,7 @@ void do_segment_not_exists(struct pt_regs *regs, unsigned long error_code)
kerror("do_segment_not_exists(11),\tError Code:%#18lx,\tRSP:%#18lx,\tRIP:%#18lx\t CPU:%d\n", error_code, regs->rsp, regs->rip, proc_current_cpu_id);
current_pcb->state = PROC_STOPPED;
sched_cfs();
sched();
}
// 12 #SS SS段错误
@ -162,7 +162,7 @@ void do_stack_segment_fault(struct pt_regs *regs, unsigned long error_code)
kerror("do_stack_segment_fault(12),\tError Code:%#18lx,\tRSP:%#18lx,\tRIP:%#18lx\t CPU:%d\n", error_code, regs->rsp, regs->rip, proc_current_cpu_id);
current_pcb->state = PROC_STOPPED;
sched_cfs();
sched();
}
// 13 #GP 通用保护性异常
@ -187,7 +187,7 @@ void do_general_protection(struct pt_regs *regs, unsigned long error_code)
printk_color(RED, BLACK, "Segment Selector Index:%#010x\n", error_code & 0xfff8);
traceback(regs);
current_pcb->state = PROC_STOPPED;
sched_cfs();
sched();
}
// 14 #PF 页故障
@ -226,7 +226,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long error_code)
traceback(regs);
current_pcb->state = PROC_STOPPED;
sched_cfs();
sched();
}
// 15 Intel保留请勿使用
@ -248,7 +248,7 @@ void do_alignment_check(struct pt_regs *regs, unsigned long error_code)
kerror("do_alignment_check(17),\tError Code:%#18lx,\tRSP:%#18lx,\tRIP:%#18lx\t CPU:%d\n", error_code, regs->rsp, regs->rip, proc_current_cpu_id);
current_pcb->state = PROC_STOPPED;
sched_cfs();
sched();
}
// 18 #MC 机器检测
@ -258,7 +258,7 @@ void do_machine_check(struct pt_regs *regs, unsigned long error_code)
kerror("do_machine_check(18),\tError Code:%#18lx,\tRSP:%#18lx,\tRIP:%#18lx\t CPU:%d\n", error_code, regs->rsp, regs->rip, proc_current_cpu_id);
current_pcb->state = PROC_STOPPED;
sched_cfs();
sched();
}
// 19 #XM SIMD浮点异常
@ -268,7 +268,7 @@ void do_SIMD_exception(struct pt_regs *regs, unsigned long error_code)
kerror("do_SIMD_exception(19),\tError Code:%#18lx,\tRSP:%#18lx,\tRIP:%#18lx\t CPU:%d\n", error_code, regs->rsp, regs->rip, proc_current_cpu_id);
current_pcb->state = PROC_STOPPED;
sched_cfs();
sched();
}
// 20 #VE 虚拟化异常
@ -278,7 +278,7 @@ void do_virtualization_exception(struct pt_regs *regs, unsigned long error_code)
kerror("do_virtualization_exception(20),\tError Code:%#18lx,\tRSP:%#18lx,\tRIP:%#18lx\t CPU:%d\n", error_code, regs->rsp, regs->rip, proc_current_cpu_id);
current_pcb->state = PROC_STOPPED;
sched_cfs();
sched();
}
// 21-21 Intel保留请勿使用