Best way to handle external interrupt ?

Hi,

We have started out first embedded linux project (first linux project) with a PPC board from men with ElinOS (Linux 2.4). This PPC has a number of external interrupt inputs, and we would like to use one of these as an external sync input. An external 50Hz signal is connected to the interrupt. What is the best/ standard way to handle such an interrupt in Linux ? Do we need to write a device driver, or can we handle such an interrupt in user code ? We are using pthreads, and would like to signal a semaphore in a task when the interrupt occurs. Any pointers to help us on the correct track would be welcome.

Regards Anton Erasmus

Reply to
Anton Erasmus
Loading thread data ...

Install an interrupt handler.

Yes.

No, you cannot handle interrupts in user space.

You can implement your driver such that your application can wait for events (like an interrupt) using standard poll() / select() calls.

Best regards,

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88   Web: www.denx.de
A good aphorism is too hard for the tooth of time, and  is  not  worn
away  by  all  the  centuries,  although  it serves as food for every
epoch.                                  - Friedrich Wilhelm Nietzsche
                          _Miscellaneous Maxims and Opinions_ no. 168
Reply to
Wolfgang Denk

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.