xref: /freebsd/share/man/man9/BUS_BIND_INTR.9 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
127831515SJohn Baldwin.\" -*- nroff -*-
227831515SJohn Baldwin.\"
3*179fa75eSJohn Baldwin.\" Copyright (c) 2009 Hudson River Trading LLC
427831515SJohn Baldwin.\" Written by: John H. Baldwin <jhb@FreeBSD.org>
527831515SJohn Baldwin.\" All rights reserved.
627831515SJohn Baldwin.\"
727831515SJohn Baldwin.\" Redistribution and use in source and binary forms, with or without
827831515SJohn Baldwin.\" modification, are permitted provided that the following conditions
927831515SJohn Baldwin.\" are met:
1027831515SJohn Baldwin.\" 1. Redistributions of source code must retain the above copyright
1127831515SJohn Baldwin.\"    notice, this list of conditions and the following disclaimer.
1227831515SJohn Baldwin.\" 2. Redistributions in binary form must reproduce the above copyright
1327831515SJohn Baldwin.\"    notice, this list of conditions and the following disclaimer in the
1427831515SJohn Baldwin.\"    documentation and/or other materials provided with the distribution.
1527831515SJohn Baldwin.\"
1627831515SJohn Baldwin.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1727831515SJohn Baldwin.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1827831515SJohn Baldwin.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1927831515SJohn Baldwin.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2027831515SJohn Baldwin.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2127831515SJohn Baldwin.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2227831515SJohn Baldwin.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2327831515SJohn Baldwin.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2427831515SJohn Baldwin.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2527831515SJohn Baldwin.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2627831515SJohn Baldwin.\" SUCH DAMAGE.
2727831515SJohn Baldwin.\"
2827831515SJohn Baldwin.Dd October 14, 2009
2927831515SJohn Baldwin.Dt BUS_BIND_INTR 9
3027831515SJohn Baldwin.Os
3127831515SJohn Baldwin.Sh NAME
3227831515SJohn Baldwin.Nm BUS_BIND_INTR ,
3327831515SJohn Baldwin.Nm bus_bind_intr
3427831515SJohn Baldwin.Nd "bind an interrupt resource to a specific CPU"
3527831515SJohn Baldwin.Sh SYNOPSIS
3627831515SJohn Baldwin.In sys/param.h
3727831515SJohn Baldwin.In sys/bus.h
3827831515SJohn Baldwin.Ft int
3927831515SJohn Baldwin.Fo BUS_BIND_INTR
4027831515SJohn Baldwin.Fa "device_t dev" "device_t child" "struct resource *irq" "int cpu"
4127831515SJohn Baldwin.Fc
4227831515SJohn Baldwin.Ft int
4327831515SJohn Baldwin.Fn bus_bind_intr "device_t dev" "struct resource *irq" "int cpu"
4427831515SJohn Baldwin.Sh DESCRIPTION
4527831515SJohn BaldwinThe
4627831515SJohn Baldwin.Fn BUS_BIND_INTR
4727831515SJohn Baldwinmethod allows an interrupt resource to be pinned to a specific CPU.
4827831515SJohn BaldwinThe interrupt resource must have an interrupt handler attached via
4927831515SJohn Baldwin.Xr BUS_SETUP_INTR 9 .
5027831515SJohn BaldwinThe
5127831515SJohn Baldwin.Fa cpu
5227831515SJohn Baldwinparameter corresponds to the ID of a valid CPU in the system.
5327831515SJohn BaldwinBinding an interrupt restricts the
5427831515SJohn Baldwin.Xr cpuset 2
5527831515SJohn Baldwinof any associated interrupt threads to only include the specified CPU.
5627831515SJohn BaldwinIt may also direct the low-level interrupt handling of the interrupt to the
5727831515SJohn Baldwinspecified CPU as well,
5827831515SJohn Baldwinbut this behavior is platform-dependent.
5927831515SJohn BaldwinIf the value
6027831515SJohn Baldwin.Dv NOCPU
6127831515SJohn Baldwinis used for
6227831515SJohn Baldwin.Fa cpu ,
6327831515SJohn Baldwinthen the interrupt will be
6427831515SJohn Baldwin.Dq unbound
6527831515SJohn Baldwinwhich restores any associated interrupt threads back to the default cpuset.
6627831515SJohn Baldwin.Pp
6727831515SJohn BaldwinNon-sleepable locks such as mutexes should not be held across calls to these
6827831515SJohn Baldwinfunctions.
6927831515SJohn Baldwin.Pp
7027831515SJohn BaldwinThe
7127831515SJohn Baldwin.Fn bus_bind_intr
7227831515SJohn Baldwinfunction is a simple wrapper around
7327831515SJohn Baldwin.Fn BUS_BIND_INTR .
7427831515SJohn Baldwin.Pp
7527831515SJohn BaldwinNote that currently there is no attempt made to arbitrate between
7627831515SJohn Baldwinmultiple bind requests for the same interrupt from either the same
7727831515SJohn Baldwindevice or multiple devices.
7827831515SJohn BaldwinThere is also no arbitration between interrupt binding requests submitted
7927831515SJohn Baldwinby userland via
8027831515SJohn Baldwin.Xr cpuset 2
8127831515SJohn Baldwinand
8227831515SJohn Baldwin.Fn BUS_BIND_INTR .
8327831515SJohn BaldwinThe most recent binding request is the one that will be in effect.
8438d3501aSJohn Baldwin.Sh RETURN VALUES
8538d3501aSJohn BaldwinZero is returned on success, otherwise an appropriate error is returned.
8627831515SJohn Baldwin.Sh SEE ALSO
8727831515SJohn Baldwin.Xr cpuset 2 ,
881e9469d1SChristian Brueffer.Xr BUS_SETUP_INTR 9 ,
8927831515SJohn Baldwin.Xr device 9
9027831515SJohn Baldwin.Sh HISTORY
9127831515SJohn BaldwinThe
9227831515SJohn Baldwin.Fn BUS_BIND_INTR
9327831515SJohn Baldwinmethod and
9427831515SJohn Baldwin.Fn bus_bind_intr
9527831515SJohn Baldwinfunctions first appeared in
9627831515SJohn Baldwin.Fx 7.2 .
97