fix bug in handling the timer interrupt
=> sending EOI before task switching
This commit is contained in:
parent
5290cd0002
commit
0410594ae8
2 changed files with 8 additions and 6 deletions
|
@ -253,7 +253,7 @@ void irq_handler(struct state *s)
|
|||
*/
|
||||
if (apic_is_enabled() || s->int_no >= 123) {
|
||||
apic_eoi();
|
||||
return;
|
||||
goto leave_handler;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_ROCKCREEK
|
||||
|
@ -273,4 +273,9 @@ void irq_handler(struct state *s)
|
|||
#else
|
||||
kprintf("Upps, RockCreek uses IRQs below 123!\n");
|
||||
#endif
|
||||
|
||||
leave_handler:
|
||||
// timer interrupt?
|
||||
if ((s->int_no == 32) || (s->int_no == 123))
|
||||
scheduler(); // switch to a new task
|
||||
}
|
||||
|
|
|
@ -69,15 +69,12 @@ static void timer_handler(struct state *s)
|
|||
#endif
|
||||
|
||||
/*
|
||||
* Every TIMER_FREQ clocks (approximately 1 second), we will
|
||||
* Every TIMER_FREQ clocks (approximately 1 second), we will
|
||||
* display a message on the screen
|
||||
*/
|
||||
*/
|
||||
/*if (timer_ticks % TIMER_FREQ == 0) {
|
||||
vga_puts("One second has passed\n");
|
||||
}*/
|
||||
|
||||
// switch to a new task
|
||||
scheduler();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue