[uClinux-dev] Re:Re: [uClinux-dev] question about Interrupt handler

Tom Walsh tom at cyberiansoftware.com
Mon Nov 19 13:07:47 EST 2001


JoeyShen wrote:
> 
> Thanks, Greg!
> I think I know what you meant. But if I want to "tell" my applications the interrupt has occured, what can I do? Using FIFO, sending msg or some other kinds of IPCs?
> Can interrupt handler creat a FIFO which would be read by process?
> Hm....maybe what I need is just polling.
> Regards.
> Joey

How about implementing an IOCTL where you pass along the address of one
of your functions located in user space.  Then your interrupt driver can
call that user space function when an interrupt is processed? 
Dangerous, but do-able, just "close" that IOCTL function when your user
app exits.

Something like:

   if ((trigger = open("/dev/trigger", O_RDONLY)) == 0) {
      printf ("Failed to open the TRIGGER\n");
      exit (0);
   }

   ioctl (trigger, TRIGGER_SET_CALLBACK, (unsigned long)
&TriggerTripped);

TomW

-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------
This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/



More information about the uClinux-dev mailing list