Update physio(9) for physread()/physwrite() separation.
[dragonfly.git] / share / man / man9 / bus_get_resource.9
1 .\"
2 .\" Copyright (c) 2008
3 .\"     The DragonFly Project.  All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\"
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in
13 .\"    the documentation and/or other materials provided with the
14 .\"    distribution.
15 .\" 3. Neither the name of The DragonFly Project nor the names of its
16 .\"    contributors may be used to endorse or promote products derived
17 .\"    from this software without specific, prior written permission.
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
23 .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\" $DragonFly: src/share/man/man9/bus_get_resource.9,v 1.1 2008/11/09 09:48:41 swildner Exp $
33 .\"
34 .Dd November 9, 2008
35 .Dt BUS_GET_RESOURCE 9
36 .Os
37 .Sh NAME
38 .Nm bus_get_resource
39 .Nd "read a resource range/value with a given resource ID"
40 .Sh SYNOPSIS
41 .In sys/param.h
42 .In sys/bus.h
43 .In sys/rman.h
44 .Ft int
45 .Fo bus_get_resource
46 .Fa "device_t dev" "int type" "int rid" "u_long *startp" "u_long *countp"
47 .Fc
48 .Sh DESCRIPTION
49 The
50 .Fn bus_get_resource
51 function reads the range or value of the resource
52 .Fa type , rid
53 pair and stores it in the
54 .Fa startp
55 and
56 .Fa countp
57 arguments.
58 .Pp
59 The arguments are as follows:
60 .Bl -tag -width ".Fa startp"
61 .It Fa dev
62 The device to read the resource from.
63 .It Fa type
64 The type of resource you want to read.
65 It is one of:
66 .Pp
67 .Bl -tag -width ".Dv SYS_RES_MEMORY" -compact
68 .It Dv SYS_RES_IRQ
69 for IRQs
70 .It Dv SYS_RES_DRQ
71 for ISA DMA lines
72 .It Dv SYS_RES_MEMORY
73 for I/O memory
74 .It Dv SYS_RES_IOPORT
75 for I/O ports
76 .El
77 .It Fa rid
78 A bus-specific handle that identifies the resource being read.
79 .It Fa startp
80 A pointer to the start address of this resource.
81 .It Fa countp
82 A pointer to the length of the resource.
83 For example, the size of the memory in bytes.
84 .El
85 .Sh RETURN VALUES
86 Zero is returned on success, otherwise an error is returned.
87 .Sh SEE ALSO
88 .Xr bus_set_resource 9 ,
89 .Xr device 9 ,
90 .Xr driver 9