Changeset View
Changeset View
Standalone View
Standalone View
head/share/man/man9/swi.9
Show All 17 Lines | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd April 19, 2012 | .Dd July 25, 2020 | ||||
.Dt SWI 9 | .Dt SWI 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm swi_add , | .Nm swi_add , | ||||
.Nm swi_remove , | .Nm swi_remove , | ||||
.Nm swi_sched | .Nm swi_sched | ||||
.Nd register and schedule software interrupt handlers | .Nd register and schedule software interrupt handlers | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
run. | run. | ||||
The | The | ||||
.Fa cookie | .Fa cookie | ||||
argument specifies which software interrupt handler should be scheduled to run. | argument specifies which software interrupt handler should be scheduled to run. | ||||
The | The | ||||
.Fa flags | .Fa flags | ||||
argument specifies how and when the handler should be run and is a mask of one | argument specifies how and when the handler should be run and is a mask of one | ||||
or more of the following flags: | or more of the following flags: | ||||
.Bl -tag -width SWI_DELAY | .Bl -tag -width SWI_FROMNMI | ||||
.It Dv SWI_DELAY | .It Dv SWI_DELAY | ||||
Specifies that the kernel should mark the specified handler as needing to run, | Specifies that the kernel should mark the specified handler as needing to run, | ||||
but the kernel should not schedule the software interrupt thread to run. | but the kernel should not schedule the software interrupt thread to run. | ||||
Instead, | Instead, | ||||
.Fa handler | .Fa handler | ||||
will be executed the next time that the software interrupt thread runs after | will be executed the next time that the software interrupt thread runs after | ||||
being scheduled by another event. | being scheduled by another event. | ||||
Attaching a handler to the clock software interrupt thread and using this flag | Attaching a handler to the clock software interrupt thread and using this flag | ||||
when scheduling a software interrupt handler can be used to implement the | when scheduling a software interrupt handler can be used to implement the | ||||
functionality performed by | functionality performed by | ||||
.Fn setdelayed | .Fn setdelayed | ||||
in earlier versions of | in earlier versions of | ||||
.Fx . | .Fx . | ||||
.It Dv SWI_FROMNMI | |||||
Specifies that | |||||
.Fn swi_sched | |||||
is called from NMI context and should be careful about used KPIs. | |||||
On platforms allowing IPI sending from NMI context it immediately wakes | |||||
.Va clk_intr_event | |||||
via the IPI, otherwise it works just like SWI_DELAY. | |||||
.El | .El | ||||
.Pp | .Pp | ||||
The | The | ||||
.Va tty_intr_event | .Va tty_intr_event | ||||
and | and | ||||
.Va clk_intr_event | .Va clk_intr_event | ||||
variables contain pointers to the software interrupt handlers for the tty and | variables contain pointers to the software interrupt handlers for the tty and | ||||
clock software interrupts, respectively. | clock software interrupts, respectively. | ||||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |