uCLinux: Timer Interrupt Handler
Having the understanding of HZ, jiffies, and system timer, it is appropriate to discuss the implementation of time management. Most of the jobs in time management are handled by a dedicated function called timer handler. In Microblaze, the kernel registers timer_interrupt as the interrupt handler: irqreturn_t TIMER_TEXT timer_interrupt(int irq, void *dev_id) { timer_ack(); write_seqlock(&xtime_lock); do_timer(1); update_process_times(user_mode(get_irq_regs())); profile_tick(CPU_PROFILING); write_sequnlock(&xtime_lock); return IRQ_HANDLED; } When kernel is executing timer handler, the timer is first acknowledged, followed by obtaining the xtime_lock lock, which protects access to jiffies and Read more