xref: /freebsd/share/man/man9/bus_get_resource.9 (revision d48a2d23039536ab9f92f88a72c27b9895796abf)
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.\" $FreeBSD$
34.\"
35.Dd September 26, 2015
36.Dt BUS_GET_RESOURCE 9
37.Os
38.Sh NAME
39.Nm bus_get_resource
40.Nd "read a resource range/value with a given resource ID"
41.Sh SYNOPSIS
42.In sys/param.h
43.In sys/bus.h
44.In sys/rman.h
45.Ft int
46.Fo bus_get_resource
47.Fa "device_t dev" "int type" "int rid" "rman_res_t *startp" "rman_res_t *countp"
48.Fc
49.Sh DESCRIPTION
50The
51.Fn bus_get_resource
52function reads the range or value of the resource
53.Fa type , rid
54pair and stores it in the
55.Fa startp
56and
57.Fa countp
58arguments.
59.Pp
60The arguments are as follows:
61.Bl -tag -width ".Fa startp"
62.It Fa dev
63The device to read the resource from.
64.It Fa type
65The type of resource you want to read.
66It is one of:
67.Pp
68.Bl -tag -width ".Dv SYS_RES_MEMORY" -compact
69.It Dv SYS_RES_IRQ
70for IRQs
71.It Dv SYS_RES_DRQ
72for ISA DMA lines
73.It Dv SYS_RES_MEMORY
74for I/O memory
75.It Dv SYS_RES_IOPORT
76for I/O ports
77.El
78.It Fa rid
79A bus-specific handle that identifies the resource being read.
80.It Fa startp
81A pointer to the start address of this resource.
82.It Fa countp
83A pointer to the length of the resource.
84For example, the size of the memory in bytes.
85.El
86.Sh RETURN VALUES
87Zero is returned on success, otherwise an error is returned.
88.Sh SEE ALSO
89.Xr bus_set_resource 9 ,
90.Xr device 9 ,
91.Xr driver 9
92.Sh AUTHORS
93This manual page was written by
94.An Sascha Wildner .
95