xref: /freebsd/share/man/man9/bus_get_resource.9 (revision b2c76c41be32f904179efed29c0ca04d53f3996c)
10d27967eSConrad Meyer.\"
20d27967eSConrad Meyer.\" Copyright (c) 2008
30d27967eSConrad Meyer.\"	The DragonFly Project.  All rights reserved.
40d27967eSConrad Meyer.\"
50d27967eSConrad Meyer.\" Redistribution and use in source and binary forms, with or without
60d27967eSConrad Meyer.\" modification, are permitted provided that the following conditions
70d27967eSConrad Meyer.\" are met:
80d27967eSConrad Meyer.\"
90d27967eSConrad Meyer.\" 1. Redistributions of source code must retain the above copyright
100d27967eSConrad Meyer.\"    notice, this list of conditions and the following disclaimer.
110d27967eSConrad Meyer.\" 2. Redistributions in binary form must reproduce the above copyright
120d27967eSConrad Meyer.\"    notice, this list of conditions and the following disclaimer in
130d27967eSConrad Meyer.\"    the documentation and/or other materials provided with the
140d27967eSConrad Meyer.\"    distribution.
150d27967eSConrad Meyer.\" 3. Neither the name of The DragonFly Project nor the names of its
160d27967eSConrad Meyer.\"    contributors may be used to endorse or promote products derived
170d27967eSConrad Meyer.\"    from this software without specific, prior written permission.
180d27967eSConrad Meyer.\"
190d27967eSConrad Meyer.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
200d27967eSConrad Meyer.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
210d27967eSConrad Meyer.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
220d27967eSConrad Meyer.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
230d27967eSConrad Meyer.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
240d27967eSConrad Meyer.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
250d27967eSConrad Meyer.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
260d27967eSConrad Meyer.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
270d27967eSConrad Meyer.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
280d27967eSConrad Meyer.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
290d27967eSConrad Meyer.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
300d27967eSConrad Meyer.\" SUCH DAMAGE.
310d27967eSConrad Meyer.\"
320d27967eSConrad Meyer.\" $DragonFly: src/share/man/man9/bus_get_resource.9,v 1.1 2008/11/09 09:48:41 swildner Exp $
330d27967eSConrad Meyer.\"
340d27967eSConrad Meyer.Dd September 26, 2015
350d27967eSConrad Meyer.Dt BUS_GET_RESOURCE 9
360d27967eSConrad Meyer.Os
370d27967eSConrad Meyer.Sh NAME
380d27967eSConrad Meyer.Nm bus_get_resource
390d27967eSConrad Meyer.Nd "read a resource range/value with a given resource ID"
400d27967eSConrad Meyer.Sh SYNOPSIS
410d27967eSConrad Meyer.In sys/param.h
420d27967eSConrad Meyer.In sys/bus.h
430d27967eSConrad Meyer.In sys/rman.h
440d27967eSConrad Meyer.Ft int
450d27967eSConrad Meyer.Fo bus_get_resource
46*2dd1bdf1SJustin Hibbits.Fa "device_t dev" "int type" "int rid" "rman_res_t *startp" "rman_res_t *countp"
470d27967eSConrad Meyer.Fc
480d27967eSConrad Meyer.Sh DESCRIPTION
490d27967eSConrad MeyerThe
500d27967eSConrad Meyer.Fn bus_get_resource
510d27967eSConrad Meyerfunction reads the range or value of the resource
520d27967eSConrad Meyer.Fa type , rid
530d27967eSConrad Meyerpair and stores it in the
540d27967eSConrad Meyer.Fa startp
550d27967eSConrad Meyerand
560d27967eSConrad Meyer.Fa countp
570d27967eSConrad Meyerarguments.
580d27967eSConrad Meyer.Pp
590d27967eSConrad MeyerThe arguments are as follows:
600d27967eSConrad Meyer.Bl -tag -width ".Fa startp"
610d27967eSConrad Meyer.It Fa dev
620d27967eSConrad MeyerThe device to read the resource from.
630d27967eSConrad Meyer.It Fa type
640d27967eSConrad MeyerThe type of resource you want to read.
650d27967eSConrad MeyerIt is one of:
660d27967eSConrad Meyer.Pp
670d27967eSConrad Meyer.Bl -tag -width ".Dv SYS_RES_MEMORY" -compact
680d27967eSConrad Meyer.It Dv SYS_RES_IRQ
690d27967eSConrad Meyerfor IRQs
700d27967eSConrad Meyer.It Dv SYS_RES_DRQ
710d27967eSConrad Meyerfor ISA DMA lines
720d27967eSConrad Meyer.It Dv SYS_RES_MEMORY
730d27967eSConrad Meyerfor I/O memory
740d27967eSConrad Meyer.It Dv SYS_RES_IOPORT
750d27967eSConrad Meyerfor I/O ports
760d27967eSConrad Meyer.El
770d27967eSConrad Meyer.It Fa rid
780d27967eSConrad MeyerA bus-specific handle that identifies the resource being read.
790d27967eSConrad Meyer.It Fa startp
800d27967eSConrad MeyerA pointer to the start address of this resource.
810d27967eSConrad Meyer.It Fa countp
820d27967eSConrad MeyerA pointer to the length of the resource.
830d27967eSConrad MeyerFor example, the size of the memory in bytes.
840d27967eSConrad Meyer.El
850d27967eSConrad Meyer.Sh RETURN VALUES
860d27967eSConrad MeyerZero is returned on success, otherwise an error is returned.
870d27967eSConrad Meyer.Sh SEE ALSO
880d27967eSConrad Meyer.Xr bus_set_resource 9 ,
890d27967eSConrad Meyer.Xr device 9 ,
900d27967eSConrad Meyer.Xr driver 9
910d27967eSConrad Meyer.Sh AUTHORS
920d27967eSConrad MeyerThis manual page was written by
930d27967eSConrad Meyer.An Sascha Wildner .
94