]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/man/man9/BUS_DESCRIBE_INTR.9
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / man / man9 / BUS_DESCRIBE_INTR.9
1 .\" -*- nroff -*-
2 .\"
3 .\" Copyright (c) 2009 Advanced Computing Technologies 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 October 14, 2009
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_BIND_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
51 The
52 .Fn BUS_DESCRIBE_INTR
53 method associates a description with an active interrupt handler.
54 The
55 .Fa cookie
56 parameter must be the value returned by a successful call to
57 .Xr BUS_SETUP_INTR 9
58 for the interrupt
59 .Fa irq .
60 .Pp
61 The
62 .Fn bus_describe_intr
63 function is a simple wrapper around
64 .Fn BUS_DESCRIBE_INTR .
65 As a convenience,
66 .Fn bus_describe_intr
67 allows the caller to use
68 .Xr printf 9
69 style formatting to build the description string using
70 .Fa fmt .
71 .Pp
72 When an interrupt handler is established by
73 .Xr BUS_SETUP_INTR 9 ,
74 the handler is named after the device the handler is established for.
75 This name is then used in various places such as interrupt statistics
76 displayed by
77 .Xr systat 1
78 and
79 .Xr vmstat 8 .
80 For devices that use a single interrupt,
81 the device name is sufficiently unique to identify the interrupt handler.
82 However, for devices that use multiple interrupts it can be useful to
83 distinguish the interrupt handlers.
84 When a description is set for an active interrupt handler,
85 a colon followed by the description is appended to the device name to form
86 the interrupt handler name.
87 .Sh RETURN VALUES
88 Zero is returned on success, otherwise an appropriate error is returned.
89 .Sh SEE ALSO
90 .Xr BUS_SETUP_INTR 9 ,
91 .Xr systat 1 ,
92 .Xr vmstat 8 ,
93 .Xr device 9 ,
94 .Xr printf 9
95 .Sh HISTORY
96 The
97 .Fn BUS_DESCRIBE_INTR
98 method and
99 .Fn bus_describe_intr
100 functions first appeared in
101 .Fx 8.1 .
102 .Sh BUGS
103 It is not currently possible to remove a description from an active interrupt
104 handler.