RMDS
RMDS

Reputation: 109

Can a Interrupt written in a kernel module (Linux) notify a running program in Qt? Without userspace program waiting/polling?

Is there anyway an interrupt coming from a kernel module can notify a Qt-embedded program running in userspace? Without using ioctl's "wait_event_interruptible()"?

I would like my program to just run as normal without having to "wait" or take a poll to check if the interrupt happened. Once the interrupt happened the program would react

This question is similar to mine How kernel notify a user space program an interrupt occurrs but he is using "wait_event_interruptible()"

Thanks

Upvotes: 1

Views: 1220

Answers (1)

fadedreamz
fadedreamz

Reputation: 1156

You can also try with the netlink (libnl). In driver all you need is the pid number to unicast message to. And from application you can use the socket's recvmsg() to wait for the even to occur.

  • [app]----{send a message to driver}---> [driver] (driver now knows the pid & saves it)
  • [app]------{blocking recvmsg}---------> waiting for the event to be raise
  • [app]<--------{message with payload}--- [driver] (sends the event info as unicast to the pid)

hope this helps,

regards

Upvotes: 1

Related Questions