[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: jiffies
>
> please check the function named "timer_interrupts". The code is
> actully in the "do_timer" function.
> When timer interrupt occurs, ISR will update jiffies.
>
Yep, I just read it, but how the hardware timer is programmed, in other words,
where is the code that attach do_timer at hw timer?
Hi,
The hooking up of timer ISR is very board / architecture specific. I
currently am having a very MIPS specific 2.6.15 kernel code with me,
but still I can vaguely see how it is done in i386:
1) The do_timer() is called by do_timer_interrupt_hook()
(include/asm-i386/mach-default/do_timer.h)
2) It is called by do_timer_interrupt() (arch/i386/kernel/time.c)
3) Which in turn is called by timer_interrupt() in the same file.
Now this timer_interrupt is actually the timer ISR which needs to be
hooked onto the particular irq.
4) Instead of doing this with request_irq(), following low level
interfaces are used:
static struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT,
CPU_MASK_NONE, "timer", NULL, NULL};
void __init time_init_hook(void)
{
setup_irq(0, &irq0);
}
Thanks,
Rajat
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ