xref: /freebsd/share/man/man9/BUS_DESCRIBE_INTR.9 (revision fed1ca4b719c56c930f2259d80663cd34be812bb)
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.\" $FreeBSD$
29.\"
30.Dd December 9, 2015
31.Dt BUS_DESCRIBE_INTR 9
32.Os
33.Sh NAME
34.Nm BUS_DESCRIBE_INTR ,
35.Nm bus_describe_intr
36.Nd "associate a description with an active interrupt handler"
37.Sh SYNOPSIS
38.In sys/param.h
39.In sys/bus.h
40.Ft int
41.Fo BUS_DESCRIBE_INTR
42.Fa "device_t dev" "device_t child" "struct resource *irq" "void *cookie"
43.Fa "const char *descr"
44.Fc
45.Ft int
46.Fo bus_describe_intr
47.Fa "device_t dev" "struct resource *irq" "void *cookie" "const char *fmt"
48.Fa ...
49.Fc
50.Sh DESCRIPTION
51The
52.Fn BUS_DESCRIBE_INTR
53method associates a description with an active interrupt handler.
54The
55.Fa cookie
56parameter must be the value returned by a successful call to
57.Xr BUS_SETUP_INTR 9
58for the interrupt
59.Fa irq .
60.Pp
61The
62.Fn bus_describe_intr
63function is a simple wrapper around
64.Fn BUS_DESCRIBE_INTR .
65As a convenience,
66.Fn bus_describe_intr
67allows the caller to use
68.Xr printf 9
69style formatting to build the description string using
70.Fa fmt .
71.Pp
72When an interrupt handler is established by
73.Xr BUS_SETUP_INTR 9 ,
74the handler is named after the device the handler is established for.
75This name is then used in various places such as interrupt statistics
76displayed by
77.Xr systat 1
78and
79.Xr vmstat 8 .
80For devices that use a single interrupt,
81the device name is sufficiently unique to identify the interrupt handler.
82However, for devices that use multiple interrupts it can be useful to
83distinguish the interrupt handlers.
84When a description is set for an active interrupt handler,
85a colon followed by the description is appended to the device name to form
86the interrupt handler name.
87.Sh RETURN VALUES
88Zero is returned on success, otherwise an appropriate error is returned.
89.Sh SEE ALSO
90.Xr systat 1 ,
91.Xr vmstat 8 ,
92.Xr BUS_SETUP_INTR 9 ,
93.Xr device 9 ,
94.Xr printf 9
95.Sh HISTORY
96The
97.Fn BUS_DESCRIBE_INTR
98method and
99.Fn bus_describe_intr
100functions first appeared in
101.Fx 8.1 .
102.Sh BUGS
103It is not currently possible to remove a description from an active interrupt
104handler.
105