xref: /freebsd/share/man/man9/bus_set_resource.9 (revision 1f4bcc459a76b7aa664f3fd557684cd0ba6da352)
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 "associate a definite resource with a given resource ID"
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.Fo bus_set_resource
46.Fa "device_t dev" "int type" "int rid" "rman_res_t start" "rman_res_t count"
47.Fc
48.Sh DESCRIPTION
49The
50.Fn bus_set_resource
51function
52sets the start address of the resource
53.Fa type , rid
54pair to be
55.Fa count
56long.
57Typically, client drivers do not use this interface.
58Bus drivers, however, often use it to set up the resources a client
59driver uses.
60.Pp
61The arguments are as follows:
62.Bl -tag -width indent
63.It Fa dev
64The device to set the resource on.
65.It Fa type
66The type of resource you want to allocate.
67It is one of:
68.Pp
69.Bl -tag -width ".Dv SYS_RES_MEMORY" -compact
70.It Dv SYS_RES_IRQ
71for IRQs
72.It Dv SYS_RES_DRQ
73for ISA DMA lines
74.It Dv SYS_RES_IOPORT
75for I/O ports
76.It Dv SYS_RES_MEMORY
77for I/O memory
78.El
79.It Fa rid
80A bus-specific handle that identifies the resource being allocated.
81.It Fa start
82The start address of this resource.
83.It Fa count
84The length of the resource.
85For example, the size of the memory in bytes.
86.El
87.Sh RETURN VALUES
88Zero is returned on success, otherwise an error is returned.
89.Sh SEE ALSO
90.Xr bus_alloc_resource 9 ,
91.Xr bus_get_resource 9 ,
92.Xr device 9 ,
93.Xr driver 9
94.Sh AUTHORS
95This manual page was written by
96.An Warner Losh Aq Mt imp@FreeBSD.org .
97