xref: /freebsd/share/man/man9/BUS_BIND_INTR.9 (revision 1da7f3f6f72b2245e458fc7195733268ae4a1136)
1.\" -*- nroff -*-
2.\"
3.\" Copyright (c) 2009 Hudson River Trading LLC
4.\" Written by: John H. Baldwin <jhb@FreeBSD.org>
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.Dd October 14, 2009
29.Dt BUS_BIND_INTR 9
30.Os
31.Sh NAME
32.Nm BUS_BIND_INTR ,
33.Nm bus_bind_intr
34.Nd "bind an interrupt resource to a specific CPU"
35.Sh SYNOPSIS
36.In sys/param.h
37.In sys/bus.h
38.Ft int
39.Fo BUS_BIND_INTR
40.Fa "device_t dev" "device_t child" "struct resource *irq" "int cpu"
41.Fc
42.Ft int
43.Fn bus_bind_intr "device_t dev" "struct resource *irq" "int cpu"
44.Sh DESCRIPTION
45The
46.Fn BUS_BIND_INTR
47method allows an interrupt resource to be pinned to a specific CPU.
48The interrupt resource must have an interrupt handler attached via
49.Xr BUS_SETUP_INTR 9 .
50The
51.Fa cpu
52parameter corresponds to the ID of a valid CPU in the system.
53Binding an interrupt restricts the
54.Xr cpuset 2
55of any associated interrupt threads to only include the specified CPU.
56It may also direct the low-level interrupt handling of the interrupt to the
57specified CPU as well,
58but this behavior is platform-dependent.
59If the value
60.Dv NOCPU
61is used for
62.Fa cpu ,
63then the interrupt will be
64.Dq unbound
65which restores any associated interrupt threads back to the default cpuset.
66.Pp
67Non-sleepable locks such as mutexes should not be held across calls to these
68functions.
69.Pp
70The
71.Fn bus_bind_intr
72function is a simple wrapper around
73.Fn BUS_BIND_INTR .
74.Pp
75Note that currently there is no attempt made to arbitrate between
76multiple bind requests for the same interrupt from either the same
77device or multiple devices.
78There is also no arbitration between interrupt binding requests submitted
79by userland via
80.Xr cpuset 2
81and
82.Fn BUS_BIND_INTR .
83The most recent binding request is the one that will be in effect.
84.Sh RETURN VALUES
85Zero is returned on success, otherwise an appropriate error is returned.
86.Sh SEE ALSO
87.Xr cpuset 2 ,
88.Xr BUS_SETUP_INTR 9 ,
89.Xr device 9
90.Sh HISTORY
91The
92.Fn BUS_BIND_INTR
93method and
94.Fn bus_bind_intr
95functions first appeared in
96.Fx 7.2 .
97