I have a PCIe device that will send a hardware interrupt when a data buffer is ready to be read. I believe the best approach for this is to use signals but I'm not entirely sure how. What I believe I need to do is:
- Save the PID of the user space application so the driver knows where to send the signal
- In the interrupt handler of the PCIe device driver, send a signal to the user space application
- In the User space application implement a signal handler function for processing the signal
I'm not sure how to do either of these. How/Where do I save the PID of the user space application? How do I send a signal to that specific PID from the driver's interrupt handler (I believe I should use the kill command but I'm more interested in the syntax of getting the PID)? How do I have the user space application wait for the signal after saving its PID? Is it possible to have the user space application continue to run after saving its PID, run the signal handler function when a signal is received, and continue running where it was before the signal arrived? (similar to how an ISR works)