Re: kernel timer problem

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

 



Hi, 
Make the following changes:
TimerFunctionTimer.function = &timerFunction;

Add an __exit section where you delete the timer 
del_timer (& TimerFunctionTimer);


From: Saransh Mittal <saransh.m@xxxxxxxxx>
To: kernelnewbies@xxxxxxxxxxxx
Sent: Thursday, March 19, 2009 3:54:43 PM
Subject: kernel timer problem

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.


[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