xref: /freebsd/share/man/man9/bus_set_resource.9 (revision 77b7cdf1999ee965ad494fddd184b18f532ac91a)
1.\" -*- nroff -*-
2.\"
3.\" Copyright (c) 2003 M. Warner Losh
4.\"
5.\" All rights reserved.
6.\"
7.\" This program is free software.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
19.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
22.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28.\"
29.\" $FreeBSD$
30.\"
31.Dd March 29, 2003
32.Dt BUS_SET_RESOURCE 9
33.Os
34.Sh NAME
35.Nm bus_set_resource
36.Nd Associates a definite resource with a given rid.
37.Sh SYNOPSIS
38.In sys/param.h
39.In sys/bus.h
40.Pp
41.In machine/bus.h
42.In sys/rman.h
43.In machine/resource.h
44.Ft int
45.Fn bus_set_resource "device_t dev" "int type" "int rid" "u_long start" "u_long count"
46.Sh DESCRIPTION
47Set the start address of the resource type, rid pair to be count long.
48Typically client drivers do not use this interface.
49Bus drivers, however, often use it to setup the resources a client
50driver users.
51.Pp
52Its arguments are as follows:
53.Bl -item
54.It
55.Fa dev
56is the device to set the resource on.
57.It
58.Fa type
59is the type of resource you want to allocate.
60It is one of:
61.Bl -tag -width SYS_RES_MEMORY
62.It Dv SYS_RES_IRQ
63for IRQs
64.It Dv SYS_RES_DRQ
65for ISA DMA lines
66.It Dv SYS_RES_IOPORT
67for I/O ports
68.It Dv SYS_RES_MEMORY
69for I/O memory
70.El
71.It
72.Fa rid
73points to a bus specific handle that identifies the resource being allocated.
74.It
75.Fa start
76is the beginning address of this resource.
77.It
78.Fa count
79is the length of the resource.
80.El
81.Sh RETURN VALUES
82Zero indicates success.
83Non-zero is an error from errno.h.
84.\".Sh EXAMPLES
85.\".Bd -literal
86.\".Ed
87.Sh SEE ALSO
88.Xr bus_alloc_resource 9 ,
89.Xr bus_get_resource 9 ,
90.Xr device 9 ,
91.Xr driver 9
92.Sh AUTHORS
93.An -nosplit
94This man page was written by
95.An Warner Losh Aq imp@FreeBSD.org .
96