xxchpoll() interface

Hello

I have a non-STREAMs based character device driver. I want to implement my own xxchpoll() routine.

As per the man page of chpoll(9E), if anyyet is not set, the driver must return an instance of the local pollhead structure.... In which routine (xxattach, xxopen etc) do I store this local pollhead structure and how do I initialize it ?

Also, in linux, we have spin_lock() and spin_lock_bh(). the difference being that the latter function also disables bottom half execution ( and should be used with locks accessed both from bottom half/tasklet contexts)..

Is there an equivalent set of Solaris functions that do this ? As far as I know, the mutex_enter() function is used to lock both Adaptive locks as well as spinlocks (correct me if I am wrong)

Awaiting replies..

-Kaushik

[826 byte] By [Kaushikgoa1a] at [2007-11-27 8:54:45]
# 1

Hello.

Each device has its own pollhead structure. Your driver must provide it. This means for each device managed by your driver you must allocate memory for a pollhead structure.

The structure is initialized by the poll() system call (after your xxchpoll structure returned it).

You must not call pollwakeup() before xxchpoll() has been called. (When initializing the structure with NUL bytes you can call pollwakeup before, but this is INOFFICIAL.)

Martin

Martin_Rosenaua at 2007-7-12 21:14:36 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 2
So do you mean I have a per-instance pollhead structure and I make the *phpp (4th argument to xxchpoll) point to the address of this pollhead structure so that once xxchpoll() returns, my local pollhead structure (for that instance of the driver) will be initialized ?
Kaushikgoa1a at 2007-7-12 21:14:36 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 3
I think this is correct.(However the drivers I have written up to now did not support poll.)
Martin_Rosenaua at 2007-7-12 21:14:36 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...