LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-18-2010, 03:07 AM   #1
double-out
LQ Newbie
 
Registered: Sep 2006
Posts: 2

Rep: Reputation: 0
Passing data from interrupt handler function to tasklet function in kernel programmin


Dear all

I am doing some Linux kernel programming for my research project.

I need to record the timestamp (by using cpuid and rdtsc) when an interrupt handler (top half) is first invoked. Due to the time critical nature of the problem itself, I have to do the timestamping inside the interrupt handler itself (the first operation when the handler is called).

However, I understand that tasks that are not so time critical should be deferred to a tasklet function (bottom half) for processing because other interrupts are disabled in a (top-half) interrupt handler.

I am currently out of idea on how I can pass the timestamp information that I have obtained in the interrupt handler to the corresponding tasklet function. Would anyone please advise?

Thanks and Best Wishes!
YY
 
Old 05-18-2010, 11:07 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

If I'm understanding you correctly, then your interrupt handler would simply schedule your tasklet (initializing the tasklet's input data - the time stamp - before it starts).

Here's an example:
http://www.tutorialized.com/view/tut...k-queues/57758

'Hope that helps .. PSM
 
Old 05-18-2010, 10:10 PM   #3
double-out
LQ Newbie
 
Registered: Sep 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by paulsm4 View Post
Hi -

If I'm understanding you correctly, then your interrupt handler would simply schedule your tasklet (initializing the tasklet's input data - the time stamp - before it starts).

Here's an example:
http://www.tutorialized.com/view/tut...k-queues/57758

'Hope that helps .. PSM
First of all, thanks a lot for your reply, paulsm4.

I am actually modifying the Madwifi driver, in which the tasklet is initialized in an separate function invoked when the driver module is first probed. The interrupt handler does not provide any data to the tasklet.

However, as you suggested in your previous reply, is it possible to initialize and pass data to a tasklet every time an interrupt happens (in the interrupt handler)?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel panic: killing interrupt handler! In interrupt handler - not syncing. divyashree Programming 26 05-15-2010 01:27 PM
<0>Kernel panic: Aiee, killing interrupt handler! In interrupt handler - not syncing mrb Linux - Newbie 2 01-09-2005 09:47 AM
A main can be changed by a function local without passing anything to the function? ananthbv Programming 10 05-04-2004 01:31 PM
can interrupt handler call user space function? pot_po Programming 0 11-07-2002 09:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration