186d7f5d3SJohn Marino.\" 286d7f5d3SJohn Marino.\" Copyright (c) 2008 386d7f5d3SJohn Marino.\" The DragonFly Project. All rights reserved. 486d7f5d3SJohn Marino.\" 586d7f5d3SJohn Marino.\" Redistribution and use in source and binary forms, with or without 686d7f5d3SJohn Marino.\" modification, are permitted provided that the following conditions 786d7f5d3SJohn Marino.\" are met: 886d7f5d3SJohn Marino.\" 986d7f5d3SJohn Marino.\" 1. Redistributions of source code must retain the above copyright 1086d7f5d3SJohn Marino.\" notice, this list of conditions and the following disclaimer. 1186d7f5d3SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright 1286d7f5d3SJohn Marino.\" notice, this list of conditions and the following disclaimer in 1386d7f5d3SJohn Marino.\" the documentation and/or other materials provided with the 1486d7f5d3SJohn Marino.\" distribution. 1586d7f5d3SJohn Marino.\" 3. Neither the name of The DragonFly Project nor the names of its 1686d7f5d3SJohn Marino.\" contributors may be used to endorse or promote products derived 1786d7f5d3SJohn Marino.\" from this software without specific, prior written permission. 1886d7f5d3SJohn Marino.\" 1986d7f5d3SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2086d7f5d3SJohn Marino.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2186d7f5d3SJohn Marino.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 2286d7f5d3SJohn Marino.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 2386d7f5d3SJohn Marino.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 2486d7f5d3SJohn Marino.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 2586d7f5d3SJohn Marino.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 2686d7f5d3SJohn Marino.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 2786d7f5d3SJohn Marino.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2886d7f5d3SJohn Marino.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 2986d7f5d3SJohn Marino.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3086d7f5d3SJohn Marino.\" SUCH DAMAGE. 3186d7f5d3SJohn Marino.\" 3286d7f5d3SJohn Marino.\" $DragonFly: src/share/man/man9/bus_get_resource.9,v 1.1 2008/11/09 09:48:41 swildner Exp $ 3386d7f5d3SJohn Marino.\" 3486d7f5d3SJohn Marino.Dd November 9, 2008 3586d7f5d3SJohn Marino.Dt BUS_GET_RESOURCE 9 3686d7f5d3SJohn Marino.Os 3786d7f5d3SJohn Marino.Sh NAME 3886d7f5d3SJohn Marino.Nm bus_get_resource 3986d7f5d3SJohn Marino.Nd "read a resource range/value with a given resource ID" 4086d7f5d3SJohn Marino.Sh SYNOPSIS 4186d7f5d3SJohn Marino.In sys/param.h 4286d7f5d3SJohn Marino.In sys/bus.h 4386d7f5d3SJohn Marino.In sys/rman.h 4486d7f5d3SJohn Marino.Ft int 4586d7f5d3SJohn Marino.Fo bus_get_resource 4686d7f5d3SJohn Marino.Fa "device_t dev" "int type" "int rid" "u_long *startp" "u_long *countp" 4786d7f5d3SJohn Marino.Fc 4886d7f5d3SJohn Marino.Sh DESCRIPTION 4986d7f5d3SJohn MarinoThe 5086d7f5d3SJohn Marino.Fn bus_get_resource 5186d7f5d3SJohn Marinofunction reads the range or value of the resource 5286d7f5d3SJohn Marino.Fa type , rid 5386d7f5d3SJohn Marinopair and stores it in the 5486d7f5d3SJohn Marino.Fa startp 5586d7f5d3SJohn Marinoand 5686d7f5d3SJohn Marino.Fa countp 5786d7f5d3SJohn Marinoarguments. 5886d7f5d3SJohn Marino.Pp 5986d7f5d3SJohn MarinoThe arguments are as follows: 6086d7f5d3SJohn Marino.Bl -tag -width ".Fa startp" 6186d7f5d3SJohn Marino.It Fa dev 6286d7f5d3SJohn MarinoThe device to read the resource from. 6386d7f5d3SJohn Marino.It Fa type 6486d7f5d3SJohn MarinoThe type of resource you want to read. 6586d7f5d3SJohn MarinoIt is one of: 6686d7f5d3SJohn Marino.Pp 6786d7f5d3SJohn Marino.Bl -tag -width ".Dv SYS_RES_MEMORY" -compact 6886d7f5d3SJohn Marino.It Dv SYS_RES_IRQ 6986d7f5d3SJohn Marinofor IRQs 7086d7f5d3SJohn Marino.It Dv SYS_RES_DRQ 7186d7f5d3SJohn Marinofor ISA DMA lines 7286d7f5d3SJohn Marino.It Dv SYS_RES_MEMORY 7386d7f5d3SJohn Marinofor I/O memory 7486d7f5d3SJohn Marino.It Dv SYS_RES_IOPORT 7586d7f5d3SJohn Marinofor I/O ports 7686d7f5d3SJohn Marino.El 7786d7f5d3SJohn Marino.It Fa rid 7886d7f5d3SJohn MarinoA bus-specific handle that identifies the resource being read. 7986d7f5d3SJohn Marino.It Fa startp 8086d7f5d3SJohn MarinoA pointer to the start address of this resource. 8186d7f5d3SJohn Marino.It Fa countp 8286d7f5d3SJohn MarinoA pointer to the length of the resource. 8386d7f5d3SJohn MarinoFor example, the size of the memory in bytes. 8486d7f5d3SJohn Marino.El 8586d7f5d3SJohn Marino.Sh RETURN VALUES 8686d7f5d3SJohn MarinoZero is returned on success, otherwise an error is returned. 8786d7f5d3SJohn Marino.Sh SEE ALSO 8886d7f5d3SJohn Marino.Xr bus_set_resource 9 , 8986d7f5d3SJohn Marino.Xr device 9 , 9086d7f5d3SJohn Marino.Xr driver 9 91