From: llj098@gmail.com (lijin liu)
To: kernelnewbies@lists.kernelnewbies.org
Subject: add_timer crashes the kernel,Why?
Date: Mon, 20 Dec 2010 16:27:11 +0800 [thread overview]
Message-ID: <AANLkTi=419O_8qyNP91XzL+OutqU2Uv20c3qhSg1Fz3w@mail.gmail.com> (raw)
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;
//active the timer:
add_timer(&timer);
When I insmod the module, the kernel crashed, and when I change my
code to *mod_timer* rather than add_timer.
It just works!
But why the add_timer crash the kernel?
next reply other threads:[~2010-12-20 8:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-20 8:27 lijin liu [this message]
2010-12-20 8:43 ` add_timer crashes the kernel,Why? Raz
2010-12-20 9:06 ` Wick
[not found] ` <AANLkTikY4+BqhjrNYiwR+1WrN53+_6JGiCkJ-kCTGL-B@mail.gmail.com>
2010-12-20 9:06 ` lijin liu
2010-12-20 9:33 ` Mulyadi Santosa
2010-12-20 9:08 ` Mulyadi Santosa
2010-12-20 14:15 ` Dexter Haslem
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTi=419O_8qyNP91XzL+OutqU2Uv20c3qhSg1Fz3w@mail.gmail.com' \
--to=llj098@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).