Skip to content

Commit

Permalink
add sched_class_proc_tick.(chyyuu#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohndeVostok committed Mar 11, 2018
1 parent 97b1ec4 commit 6763945
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion labcodes/lab6/kern/schedule/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sched_class_pick_next(void) {
return sched_class->pick_next(rq);
}

static void
void
sched_class_proc_tick(struct proc_struct *proc) {
if (proc != idleproc) {
sched_class->proc_tick(rq, proc);
Expand Down
1 change: 1 addition & 0 deletions labcodes/lab6/kern/schedule/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ struct run_queue {
void sched_init(void);
void wakeup_proc(struct proc_struct *proc);
void schedule(void);
void sched_class_proc_tick(struct proc_struct *proc);

#endif /* !__KERN_SCHEDULE_SCHED_H__ */

2 changes: 1 addition & 1 deletion labcodes_answer/lab6_result/kern/schedule/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sched_class_pick_next(void) {
return sched_class->pick_next(rq);
}

static void
void
sched_class_proc_tick(struct proc_struct *proc) {
if (proc != idleproc) {
sched_class->proc_tick(rq, proc);
Expand Down
1 change: 1 addition & 0 deletions labcodes_answer/lab6_result/kern/schedule/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ struct run_queue {
void sched_init(void);
void wakeup_proc(struct proc_struct *proc);
void schedule(void);
void sched_class_proc_tick(struct proc_struct *proc);

#endif /* !__KERN_SCHEDULE_SCHED_H__ */

3 changes: 2 additions & 1 deletion labcodes_answer/lab6_result/kern/trap/trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ trap_dispatch(struct trapframe *tf) {
*/
ticks ++;
assert(current != NULL);
break;
sched_class_proc_tick(current);
break;
case IRQ_OFFSET + IRQ_COM1:
c = cons_getc();
cprintf("serial [%03d] %c\n", c, c);
Expand Down

0 comments on commit 6763945

Please sign in to comment.