xref: /freebsd/share/man/man9/BUS_DESCRIBE_INTR.9 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
137b8ef16SJohn Baldwin.\" -*- nroff -*-
237b8ef16SJohn Baldwin.\"
3179fa75eSJohn Baldwin.\" Copyright (c) 2009 Hudson River Trading LLC
437b8ef16SJohn Baldwin.\" Written by: John H. Baldwin <jhb@FreeBSD.org>
537b8ef16SJohn Baldwin.\" All rights reserved.
637b8ef16SJohn Baldwin.\"
737b8ef16SJohn Baldwin.\" Redistribution and use in source and binary forms, with or without
837b8ef16SJohn Baldwin.\" modification, are permitted provided that the following conditions
937b8ef16SJohn Baldwin.\" are met:
1037b8ef16SJohn Baldwin.\" 1. Redistributions of source code must retain the above copyright
1137b8ef16SJohn Baldwin.\"    notice, this list of conditions and the following disclaimer.
1237b8ef16SJohn Baldwin.\" 2. Redistributions in binary form must reproduce the above copyright
1337b8ef16SJohn Baldwin.\"    notice, this list of conditions and the following disclaimer in the
1437b8ef16SJohn Baldwin.\"    documentation and/or other materials provided with the distribution.
1537b8ef16SJohn Baldwin.\"
1637b8ef16SJohn Baldwin.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1737b8ef16SJohn Baldwin.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1837b8ef16SJohn Baldwin.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1937b8ef16SJohn Baldwin.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2037b8ef16SJohn Baldwin.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2137b8ef16SJohn Baldwin.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2237b8ef16SJohn Baldwin.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2337b8ef16SJohn Baldwin.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2437b8ef16SJohn Baldwin.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2537b8ef16SJohn Baldwin.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2637b8ef16SJohn Baldwin.\" SUCH DAMAGE.
2737b8ef16SJohn Baldwin.\"
28*38295fe1SJohn Baldwin.Dd December 9, 2015
2937b8ef16SJohn Baldwin.Dt BUS_DESCRIBE_INTR 9
3037b8ef16SJohn Baldwin.Os
3137b8ef16SJohn Baldwin.Sh NAME
3237b8ef16SJohn Baldwin.Nm BUS_DESCRIBE_INTR ,
3337b8ef16SJohn Baldwin.Nm bus_describe_intr
3437b8ef16SJohn Baldwin.Nd "associate a description with an active interrupt handler"
3537b8ef16SJohn Baldwin.Sh SYNOPSIS
3637b8ef16SJohn Baldwin.In sys/param.h
3737b8ef16SJohn Baldwin.In sys/bus.h
3837b8ef16SJohn Baldwin.Ft int
39*38295fe1SJohn Baldwin.Fo BUS_DESCRIBE_INTR
4037b8ef16SJohn Baldwin.Fa "device_t dev" "device_t child" "struct resource *irq" "void *cookie"
4137b8ef16SJohn Baldwin.Fa "const char *descr"
4237b8ef16SJohn Baldwin.Fc
4337b8ef16SJohn Baldwin.Ft int
4437b8ef16SJohn Baldwin.Fo bus_describe_intr
4537b8ef16SJohn Baldwin.Fa "device_t dev" "struct resource *irq" "void *cookie" "const char *fmt"
4637b8ef16SJohn Baldwin.Fa ...
4737b8ef16SJohn Baldwin.Fc
4837b8ef16SJohn Baldwin.Sh DESCRIPTION
4937b8ef16SJohn BaldwinThe
5037b8ef16SJohn Baldwin.Fn BUS_DESCRIBE_INTR
5137b8ef16SJohn Baldwinmethod associates a description with an active interrupt handler.
5237b8ef16SJohn BaldwinThe
5337b8ef16SJohn Baldwin.Fa cookie
5437b8ef16SJohn Baldwinparameter must be the value returned by a successful call to
5537b8ef16SJohn Baldwin.Xr BUS_SETUP_INTR 9
5637b8ef16SJohn Baldwinfor the interrupt
5737b8ef16SJohn Baldwin.Fa irq .
5837b8ef16SJohn Baldwin.Pp
5937b8ef16SJohn BaldwinThe
6037b8ef16SJohn Baldwin.Fn bus_describe_intr
6137b8ef16SJohn Baldwinfunction is a simple wrapper around
6237b8ef16SJohn Baldwin.Fn BUS_DESCRIBE_INTR .
6337b8ef16SJohn BaldwinAs a convenience,
6437b8ef16SJohn Baldwin.Fn bus_describe_intr
6537b8ef16SJohn Baldwinallows the caller to use
6637b8ef16SJohn Baldwin.Xr printf 9
6737b8ef16SJohn Baldwinstyle formatting to build the description string using
6837b8ef16SJohn Baldwin.Fa fmt .
6937b8ef16SJohn Baldwin.Pp
7037b8ef16SJohn BaldwinWhen an interrupt handler is established by
7137b8ef16SJohn Baldwin.Xr BUS_SETUP_INTR 9 ,
7237b8ef16SJohn Baldwinthe handler is named after the device the handler is established for.
7337b8ef16SJohn BaldwinThis name is then used in various places such as interrupt statistics
7437b8ef16SJohn Baldwindisplayed by
7537b8ef16SJohn Baldwin.Xr systat 1
7637b8ef16SJohn Baldwinand
7737b8ef16SJohn Baldwin.Xr vmstat 8 .
7837b8ef16SJohn BaldwinFor devices that use a single interrupt,
7937b8ef16SJohn Baldwinthe device name is sufficiently unique to identify the interrupt handler.
8037b8ef16SJohn BaldwinHowever, for devices that use multiple interrupts it can be useful to
8137b8ef16SJohn Baldwindistinguish the interrupt handlers.
8237b8ef16SJohn BaldwinWhen a description is set for an active interrupt handler,
8337b8ef16SJohn Baldwina colon followed by the description is appended to the device name to form
8437b8ef16SJohn Baldwinthe interrupt handler name.
8537b8ef16SJohn Baldwin.Sh RETURN VALUES
8637b8ef16SJohn BaldwinZero is returned on success, otherwise an appropriate error is returned.
8737b8ef16SJohn Baldwin.Sh SEE ALSO
8837b8ef16SJohn Baldwin.Xr systat 1 ,
897024354dSChristian Brueffer.Xr vmstat 8 ,
901e9469d1SChristian Brueffer.Xr BUS_SETUP_INTR 9 ,
917024354dSChristian Brueffer.Xr device 9 ,
927024354dSChristian Brueffer.Xr printf 9
9337b8ef16SJohn Baldwin.Sh HISTORY
9437b8ef16SJohn BaldwinThe
9537b8ef16SJohn Baldwin.Fn BUS_DESCRIBE_INTR
9637b8ef16SJohn Baldwinmethod and
9737b8ef16SJohn Baldwin.Fn bus_describe_intr
9837b8ef16SJohn Baldwinfunctions first appeared in
99668d8dd3SUlrich Spörlein.Fx 8.1 .
10037b8ef16SJohn Baldwin.Sh BUGS
10137b8ef16SJohn BaldwinIt is not currently possible to remove a description from an active interrupt
10237b8ef16SJohn Baldwinhandler.
103