amd64: entry: rework timer_handler
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
a5c0597830
commit
be49cc4839
2 changed files with 27 additions and 14 deletions
|
|
@ -72,15 +72,6 @@ uint8_t lapic_idno()
|
|||
return lapic_read(lapic_addr, LAPIC_ID) >> 24;
|
||||
}
|
||||
|
||||
static void timer_handler()
|
||||
{
|
||||
struct thread *cur = get_cur_thread();
|
||||
sched_save_state(cur);
|
||||
sched_add_thread(cur);
|
||||
lapic_eoi();
|
||||
schedule();
|
||||
}
|
||||
|
||||
static void ipi_handle_kill()
|
||||
{
|
||||
schedule();
|
||||
|
|
@ -126,7 +117,9 @@ void apic_init()
|
|||
|
||||
/* Register timer interrupt handler and enable APIC timer */
|
||||
extern int irq_map(uint8_t irq, void *func);
|
||||
irq_map(0, timer_handler);
|
||||
|
||||
void _timer_handler();
|
||||
irq_map(0, _timer_handler);
|
||||
|
||||
lapic_write(lapic_addr, LAPIC_TPR, 0);
|
||||
lapic_write(lapic_addr, LAPIC_TIMER_DIV, 0x3);
|
||||
|
|
|
|||
Loading…
Reference in a new issue