alarm task finished
This commit is contained in:
@ -77,8 +77,15 @@ usertrap(void)
|
||||
exit(-1);
|
||||
|
||||
// give up the CPU if this is a timer interrupt.
|
||||
if(which_dev == 2)
|
||||
yield();
|
||||
if(which_dev == 2){
|
||||
p->inter_cnt++;
|
||||
if (p->inter_cnt == p->alarm_cnt && 0 < p->alarm_cnt) {
|
||||
*p->pre_trapframe = *p->trapframe;
|
||||
p->trapframe->epc = p->handler;
|
||||
} else {
|
||||
yield();
|
||||
}
|
||||
}
|
||||
|
||||
usertrapret();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user