LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   How to wake up my application unless a specific SIGIO happens? (https://www.linuxquestions.org/questions/linux-kernel-70/how-to-wake-up-my-application-unless-a-specific-sigio-happens-863514/)

Soniferiel 02-18-2011 05:43 AM

How to wake up my application unless a specific SIGIO happens?
 
Hello,

I'm using a driver for a pci UART device that handles both serial ports and GPIO's by interruption.
At the application level I will have two applications one which will handles only the GPIO part and the other which will handles only the serial port communication, so I wan't my GPIO application to be awaken only if the source of the interrupt is GPIO and respectively the serial port application to be awaken only when the source of the interrupt is from a serial port.
From what I understand if I use SIGIO, my applications will be awaken for the 2 kinds of interrupts and they will have to find out if they are concerned by the interrupt. But I don't want applications to have to test if they are concerned by the interrupt.
Is there a way to do such a thing? I looked how SIGUSR signals are used but I didn't find out if they are applicable in my case?

Thanks a lot in advance for your help.

David1357 02-18-2011 03:57 PM

Quote:

Originally Posted by Soniferiel (Post 4262578)
At the application level I will have two applications one which will handles only the GPIO part and the other which will handles only the serial port communication, so I wan't my GPIO application to be awaken only if the source of the interrupt is GPIO and respectively the serial port application to be awaken only when the source of the interrupt is from a serial port.

Use SIGUSR1 and SIGUSR2 instead of SIGIO.

Soniferiel 02-21-2011 04:48 AM

Quote:

Originally Posted by David1357 (Post 4263204)
Use SIGUSR1 and SIGUSR2 instead of SIGIO.

Hi David1357,

First thanks a lot for your reply. Can you tell me if I'm understanding right: Does it mean that the interrupt handler of my device driver have to send a SIGUSR1 if the interrupt source is from a serial port and a SIGUSUR2 if the interrupt source is GPIO?

Thanks for helping!

David1357 02-21-2011 09:15 AM

Quote:

Originally Posted by Soniferiel (Post 4265691)
Can you tell me if I'm understanding right: Do you mean that the interrupt handler of my device driver should send a SIGUSR1 if the interrupt source is from a serial port and a SIGUSUR2 if the interrupt source is GPIO?

That is exactly what I am suggesting.

Soniferiel 02-23-2011 03:34 AM

Quote:

Originally Posted by David1357 (Post 4265914)
That is exactly what I am suggesting.

Ok, Thank you very much for your help.


All times are GMT -5. The time now is 04:17 PM.