mod_timer



Hi all,

I need help for using mod_timer.
------------------------------------------------------------------------------------------------------------------------------------
extern int mod_timer(struct timer_list *timer, unsigned long expires);

struct timer_list {
struct list_head entry;
unsigned long expires;

spinlock_t lock;
unsigned long magic;

void (*function)(unsigned long);
unsigned long data;

struct tvec_t_base_s *base;
};
------------------------------------------------------------------------------------------------------------------------------------
what I have done.....

int my_function(unsigned long data)
{
[snip]
}
struct timer_list timer;
[snip]
timer.function=&my_funciton()
mod_timer(&timer, jiffies + 2 * HZ)

is this code sufficient........
what are other fields in struct timer_list I can use for.........
is parameter passed (expires) in mod_timer and field (expires) in
struct timer_list same

.



Relevant Pages

  • [PATCH] [Target_Core_Mod/ConfigFS]: Added initial support for file descriptors for se_device_t
    ... Here is the first commit using Joel's recommendations allow ... target_core_mod configfs generic infrastructure to allow subsystem ... tell me how to get struct scsi_device from /dev/st0 it would be much ... <SNIP> ...
    (Linux-Kernel)
  • Re: Array assignment via struct
    ... >> 4 padding bytes are added after the array of 20 char in the struct so ... >> code to retrieve the elements of the array 8-bytes at a time and unaligned ... >> when it's accessed through the struct, ...
    (comp.lang.c)
  • Re: Help the helpless.. code read
    ... which is a pointer to a struct _roms. ... And there's no need to assume, it's all quite explicit:) ... [small snip] ... This is in contrast to something like Java, ...
    (comp.lang.c)
  • [RFC][PATCH 2/4] human-time soft-timer core changes
    ... from the timer interrupt in software, i.e. jiffies. ... timerintervals is used where we would have used the timer's expires ... extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue); ...
    (Linux-Kernel)
  • [RFC][UPDATE PATCH 2/4] human-time soft-timer core changes
    ... > from the timer interrupt in software, i.e. jiffies. ... > timerintervals is used where we would have used the timer's expires ... extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue); ...
    (Linux-Kernel)