this post to ask you the way to notify clients of my resource manager when interrupts occur.
After carefully reading the doc, I have written a resource manager for a digital I/O PCI board.
I have to handle select() calls from client processes, to inform them of level changes on I/O ports.
I have 4 ports, PC0 to PC3, each triggering an interrupt when changing level (0 to 1 or the opposite). This means 8 possible level changes.
So I would like the clients to be able to ask and to be notified when one or more of these 8 conditions occur.
thanks for the fast reply.
I re-read about iofunc_notify.
My problem is that now I can just unblock clients having called select() on my file, telling them out-of-band data is available. The read and write options are useable too, but I need 8 conditions.
So I guess my client has to call MsgSend() or devctl() to tell the resource manager which condition will unblock it.
And then call MsgReceive() to wait for the thread managing interrupts in my resource manager to MsgSend() them?
You could have the resource manager register or handle 8 different paths, one of each condition.
Or if the client can use ionotify() and MsgReceive() instead of select. Use one notification of a sigevent which you’d setup as a PULSE. But then server could use the code field of the pulse to indicate the status of the inputs. That would mean receiving an event for every change though.
There are lots of other possiblities to play with.