LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-27-2010, 07:03 PM   #1
mylinuxforums
LQ Newbie
 
Registered: Jun 2010
Posts: 1

Rep: Reputation: 0
getting notified in user-space on interrupts


Hi,
I hope this is the right place to post to because I haven't found any other related forums.
I'm working on an AMD opteron running Linux 2.6.28.6
I want to preload a hardware performance counter (register) with a value to have it overflow after a number of a specific event counts. As I understand, when the counter in the register overflows, an interrupt will be generated and handled by the appropriate interrupt handler. How can my user-level application get notified whenever the interrupt occurs? I want to obtain information on the instruction that caused the overflow. Is this possible?
I think this is different than responding to signals with sigaction(). I never dealt with interrupts before, so any help is appreciated.

Thanks
 
Old 06-28-2010, 03:13 PM   #2
irmin
Member
 
Registered: Jan 2010
Location: the universe
Distribution: Slackware (modified), Slackware64 (modified), openSuSE (modified)
Posts: 342

Rep: Reputation: 62
Hi,

as far as I know there is no syscall that allows you to handle IRQs or any other interrupts from user space. The only possibility to catch any interrupt and pass them to user space is to build your own kernel module that offers this functionality. I thing this kind of control should not be passed to userspace since you can totally mess up the peripheral hardware (like not sending ACK to the PIC or similar) blocking all interrupts of lower priority. Also interrupts are executed at ring 0 that provides your program total control over the CPU meaning that your program can change memory permissions at will during the interrupt. So the best thing will be to write a kernel module that notifies your program when the selected interrupt occurs.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Division of Logical Memory Space in to User Space and Kernel Space shreshtha Linux - Newbie 2 01-14-2010 09:59 AM
Do we have any chance of calling user space callback function from kernel space? ravishankar.g Linux - Newbie 1 09-22-2009 07:14 PM
how to call socket prog code written in user space from kernel space???HELP kurt2 Programming 2 07-15-2009 09:56 PM
serial port interrupts in user space pierre-luc Programming 2 04-24-2007 09:48 PM
Need to disable timer or all interrupts from user space G35Coupe Linux - General 0 11-16-2004 12:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:24 PM.

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