Home > other >  Arm9 boards of the kernel, the kernel timer implementation method
Arm9 boards of the kernel, the kernel timer implementation method

Time:10-02

Arm9 boards of the kernel, the kernel timer implementation method

CodePudding user response:

Struct timer_list {
Struct list_head entry;
Unsigned long expires;//the future jiffies values jiffies +
Void function (*) (unsigned long);//function to be executed by the future
Unsigned long data;//perform the function parameter
Struct tvec_base * base;
# ifdef CONFIG_TIMER_STATS
Void * start_site;
Char start_comm [16].
Int start_pid;
# endif
# ifdef CONFIG_LOCKDEP
Struct lockdep_map lockdep_map;
# endif
};
1. The definition of struct timer_list structure, initialization function pointer and parameter
2. Init_timer (timer) parameter is defined, the struct timer_list structure pointer
3. Where you need to use the first determine the future jiffies values again calling void add_timer (struct timer_list * timer);
4. You can delete the timer task int del_timer (struct timer_list * timer);
  • Related