In message: <[EMAIL PROTECTED]>
            Peter Jeremy <[EMAIL PROTECTED]> writes:
: I have a hardware interrupt handler that has to forward a signal to
: userland and that I'd like to mark INTR_FAST.  AFAIK, the normal way
: to forward a signal is:
:       if ((p = pfind(sc->pid_to_signal)) != NULL) {
:               psignal(p, SIGUSR2);
:               PROC_UNLOCK(p);
:       }
: 
: But pfind(9) does a PROC_LOCK() which implies it can sleep and therefore
: can't be used by an INTR_FAST handler.
: 
: Firstly, am I correct?  If so, is there an alternative approach I can use?

I've been storing td->td_proc in my softc and using that to signal the
process.  However, I don't know if you can call psignal without the
process being locked...  Hmmm, the big 'PROC_LOCK_ASSERT()' says that
you can't.  And the routines that psignal calls also do the
PROC_LOCK_ASSERT...  You may be stuck using some kind of helper
mechanism to accomplish this (wakeup another thread and send the
signal from there, there are many variations on this theme).

Warner
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to