Re: add_timer crashes the kernel,Why?

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

 



Hi Lijin:


On Mon, Dec 20, 2010 at 4:27 PM, lijin liu <llj098@xxxxxxxxx> wrote:
> Hello everyone!
>
> I want to use the timer in my kernel module. I read the book  _Linux
> kernel development 3rd version_  and LDD 3rd version.
>
> Both the two books tell me write the code like this:
>
> struct timer_list my_timer;
> init_timer(&my_timer);
>
> my_timer.expires = jiffies + wait;
> my_timer.data = 0;
> my_timer.function=my_function;

You just constructed my_timer.

>
> //active the timer:
> add_timer(&timer);

and add timer (not my_timer )to the timer list ...

If the problem still exists, suggest you copy all codes and crash log here.

>
>
> When I insmod the module, the kernel crashed, and when I change my
> code to *mod_timer* rather than add_timer.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[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