Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / share / man / man9 / bus_set_resource.9
1 .\"
2 .\" Copyright (c) 2003 M. Warner Losh
3 .\"
4 .\" All rights reserved.
5 .\"
6 .\" This program is free software.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\"    notice, this list of conditions and the following disclaimer in the
15 .\"    documentation and/or other materials provided with the distribution.
16 .\"
17 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
18 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 .\"
28 .\" $FreeBSD: src/share/man/man9/bus_set_resource.9,v 1.5 2005/06/28 20:15:18 hmp Exp $
29 .\" $DragonFly: src/share/man/man9/bus_set_resource.9,v 1.2 2008/11/09 09:48:41 swildner Exp $
30 .\"
31 .Dd May 27, 2007
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 .In sys/rman.h
41 .Ft int
42 .Fo bus_set_resource
43 .Fa "device_t dev" "int type" "int rid" "u_long start" "u_long count"
44 .Fc
45 .Sh DESCRIPTION
46 The
47 .Fn bus_set_resource
48 function
49 sets the
50 .Fa start
51 address of the resource
52 .Fa type , rid
53 pair to be
54 .Fa count
55 long.
56 Typically, client drivers do not use this interface.
57 Bus drivers, however, often use it to set up the resources a client driver
58 uses.
59 .Pp
60 The arguments are as follows:
61 .Bl -tag -width ".Fa start"
62 .It Fa dev
63 The device to set the resource on.
64 .It Fa type
65 The type of resource you want to allocate.
66 It is one of:
67 .Pp
68 .Bl -tag -width ".Dv SYS_RES_MEMORY" -compact
69 .It Dv SYS_RES_IRQ
70 for IRQs
71 .It Dv SYS_RES_DRQ
72 for ISA DMA lines
73 .It Dv SYS_RES_MEMORY
74 for I/O memory
75 .It Dv SYS_RES_IOPORT
76 for I/O ports
77 .El
78 .It Fa rid
79 A bus-specific handle that identifies the resource being allocated.
80 .It Fa start
81 The start address of this resource.
82 .It Fa count
83 The length of the resource.
84 For example, the size of the memory in bytes.
85 .El
86 .Sh RETURN VALUES
87 Zero is returned on success, otherwise an error is returned.
88 .Sh SEE ALSO
89 .Xr bus_alloc_resource 9 ,
90 .Xr bus_get_resource 9 ,
91 .Xr device 9 ,
92 .Xr driver 9
93 .Sh AUTHORS
94 This manual page was written by
95 .An Warner Losh Aq imp@FreeBSD.org .