Subject: Re: Proposal for generalized MI soft interrupts
To: None <sommerfeld@orchard.medford.ma.us>
From: Gordon W. Ross <gwr@mc.com>
List: tech-kern
Date: 01/30/1997 11:26:31
> Date: Thu, 30 Jan 1997 10:05:44 -0500
> From: Bill Sommerfeld <sommerfeld@orchard.medford.ma.us>

>    Soft interrupts are used as callbacks for hard interrupts.  Since a
>    soft interrupt is always registered from a hard interrupt routine,
>    it is always blocked at the time it is registered.
> 
> What about cases where one soft interrupt needs to trigger another
> soft interrupt?  For example: when running from IPL_SOFTSERIAL, you
> call the ppp line discipline, and it needs to post an IPL_SOFTNET?
> 
> 						- Bill

Solaris has a similar "softintr" facility:

     int  ddi_add_softintr();
     void ddi_remove_softintr(ddi_softintr_t id);
     void ddi_trigger_softintr(ddi_softintr_t id);

Their interface specifies that the function called as a result
of ddi_trigger_softintr() is called at low priority (something
corresponding to our splsoft).

I suggest we include in the following in interface specification:

Soft interrupt functions attached with the levels listed below are
called at the interrupt priority shown to the right:

	IPL_SOFTCLOCK		splsoftclock()
	IPL_SOFTNET		splsoftnet()
	IPL_SOFTSERIAL		spltty() *

* not sure what that last one should be.

Anyway, the point is that we should fully specify the calling
environment for the functions attached.

Another question one might ask is:  Can the attached function
possibly be called more often than the number of times one
calls softintr_request(cookie) with its cookie?  It simplifies
some MD implementations somewhat if that can be allowed.

Gordon