]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/man/man9/bus_set_resource.9
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / man / man9 / bus_set_resource.9
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" "u_long start" "u_long count"
47 .Fc
48 .Sh DESCRIPTION
49 The
50 .Fn bus_set_resource
51 function
52 sets the start address of the resource
53 .Fa type , rid
54 pair to be
55 .Fa count
56 long.
57 Typically, client drivers do not use this interface.
58 Bus drivers, however, often use it to set up the resources a client
59 driver uses.
60 .Pp
61 The arguments are as follows:
62 .Bl -tag -width indent
63 .It Fa dev
64 The device to set the resource on.
65 .It Fa type
66 The type of resource you want to allocate.
67 It is one of:
68 .Pp
69 .Bl -tag -width ".Dv SYS_RES_MEMORY" -compact
70 .It Dv SYS_RES_IRQ
71 for IRQs
72 .It Dv SYS_RES_DRQ
73 for ISA DMA lines
74 .It Dv SYS_RES_IOPORT
75 for I/O ports
76 .It Dv SYS_RES_MEMORY
77 for I/O memory
78 .El
79 .It Fa rid
80 A bus-specific handle that identifies the resource being allocated.
81 .It Fa start
82 The start address of this resource.
83 .It Fa count
84 The length of the resource.
85 For example, the size of the memory in bytes.
86 .El
87 .Sh RETURN VALUES
88 Zero 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
95 This manual page was written by
96 .An Warner Losh Aq imp@FreeBSD.org .