I have a Linux kernel module which contains the interrupt handler, and would like to somehow notify the user-space application after the interrupt was handled. Please tell me, how to do it?
Asked
Active
Viewed 3,414 times
4
-
1Can we assume that you're talking about Linux? Either way, please add the relevant tag to your question. – Oliver Charlesworth Jun 02 '13 at 20:51
-
@OliCharlesworth Yes, we are talking about Linux, but I ran out of tags – Jake Badlands Jun 02 '13 at 20:53
-
1You could, e.g., remove “hardware” in favour of “linux”. Hardware knowledge is not really important to answer this question. – chirlu Jun 02 '13 at 20:56
-
@chirlu Okay I have done it. Please lets return to the question – Jake Badlands Jun 02 '13 at 21:13
-
3The tags are important to get the right people to look at your question. See? Answers are coming. :-) – chirlu Jun 02 '13 at 21:32
3 Answers
4
-
1
-
You can use signals too to userspace :).. Only thing your kernel module should know is PID of the process which needs to trigger. I have used IOCTL to the kernel module to pass PID :). – duslabo Mar 18 '14 at 10:02
3
Use the netlink.
Netlink socket is a special IPC used for transferring information between kernel and user-space processes. It provides a full-duplex communication link between the two by way of standard socket APIs for user-space processes and a special kernel API for kernel modules. Netlink socket uses the address family AF_NETLINK, as compared to AF_INET used by TCP/IP socket. Each netlink socket feature defines its own protocol type in the kernel header file include/linux/netlink.h.

Ottavio Campana
- 4,088
- 5
- 31
- 58
0
I'm directly answering this question as it's the top result in Google for "kernel send signal to user space".
I typically use signal to kill the userspace process to examine it's stack as it calls ioctls. Typically the following works for me:
force_sig(SIGSEGV, current);

R.D.
- 2,471
- 2
- 15
- 21