Using Hardware Interrupts to invoke a user space action

"Fahd Abidi" <[email protected]> Thu, 10 Apr 2008 23:03:21 -0400
Newsgroups gmane.comp.hardware.motorola.microcontrollers.coldfire
Message-ID <071DB0C788671B48940BC79F8B4930692DC1A6@ultsol01.tewks.ultsol.local>
Hello,

I am new to uClinux and am struggling with a particular task. I have
written an application that uses an existing I2C driver to talk to a CAN
controller. I can manually invoke a read or write to the CAN controller.
The next step is to install an IRQ handler and use it to read data from
the CAN controller. In the target environment there will be several
devices writing to the CAN controller so I need to read and clear the
Receive buffers as soon as the CAN triggers a HW Interrupt which is tied
to an external interrupt on our coldfire target.

I have implemented a new module that just initializes the Interrupt
handler. What I would like to do is use the Interrupt handler to pass a
signal to my application that will tell it that data has arrived on the
CAN interface and it should go and empty the Receive buffers.

Is this possible? Can any one tell me how this could be done? What
functions can I use to pass a signal from kernel space to user space to
invoke an action in my application. Sounds like there may be thread
access issues here as the handler could invoke a write to my buffer in
memory just as I am issuing a read command to read the contents of that
buffer. Any suggestions will be greatly appreciated, as I mentioned I am
new to this arena.

Thanks,

Fahd
---
[email protected]              Send a post to the list.
[email protected]        Join the list.
[email protected]    Join the list in digest mode.
[email protected]     Leave the list.