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