Re: kernel timer problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think you need to explicitly initialize the following instance
variable of  timer_list:

TimerFunctionTimer.data = funct_parameter;   /*function parameter; in
your case a variable of type long*/

-
Rahul Pydimukkala


On Thu, Mar 19, 2009 at 3:54 PM, Saransh Mittal <saransh.m@xxxxxxxxx> wrote:
> Hey guys,
> I m trying to schedule a Kernel Timer such that a
> function I need runs when the timer expires. But with
> the current way I m doing it, the system always
> crashes.
>
> Heres what I have:
>
>
> .......
> .......
>
> /* Function Prototype */
> void timerFunction( unsigned long );
>
> .......
> .......
>
> /* Global Variables */
> struct timer_list TimerFunctionTimer;
>
> .......
> .......
>
>
> /* Inside init_module */
> init_timer ( &TimerFunctionTimer );
> TimerFunctionTimer.expires = (jiffies + HZ);
> TimerFunctionTimer.function = timerFunction;
> add_timer( &TimerFunctionTimer );
>
> ......
>
> ......
>
> Am I doing something wrong here ? Any help would be
> greatly appreciated. Thank you.



-- 
How long will you lie there, you slaggard?
When will you get up from your sleep?
A little sleep, a little slumber,
a little folding of the hands to rest
and poverty will come on you like a thief
and scarcity like a armed man.  - Proverbs 6:9

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux