2003-03-30 00:25:23 +00:00
|
|
|
.\" -*- nroff -*-
|
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2003 M. Warner Losh
|
|
|
|
.\"
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This program is free software.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
|
|
|
.Dd March 29, 2003
|
|
|
|
.Dt BUS_SET_RESOURCE 9
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm bus_set_resource
|
2003-05-30 21:13:32 +00:00
|
|
|
.Nd "associate a definite resource with a given resource ID"
|
2003-03-30 00:25:23 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.In sys/param.h
|
|
|
|
.In sys/bus.h
|
|
|
|
.Pp
|
|
|
|
.In machine/bus.h
|
|
|
|
.In sys/rman.h
|
|
|
|
.In machine/resource.h
|
|
|
|
.Ft int
|
2003-05-30 21:13:32 +00:00
|
|
|
.Fo bus_set_resource
|
2016-01-27 02:23:54 +00:00
|
|
|
.Fa "device_t dev" "int type" "int rid" "rman_res_t start" "rman_res_t count"
|
2003-05-30 21:13:32 +00:00
|
|
|
.Fc
|
2003-03-30 00:25:23 +00:00
|
|
|
.Sh DESCRIPTION
|
2003-05-30 21:13:32 +00:00
|
|
|
The
|
|
|
|
.Fn bus_set_resource
|
|
|
|
function
|
|
|
|
sets the start address of the resource
|
|
|
|
.Fa type , rid
|
|
|
|
pair to be
|
|
|
|
.Fa count
|
|
|
|
long.
|
|
|
|
Typically, client drivers do not use this interface.
|
|
|
|
Bus drivers, however, often use it to set up the resources a client
|
|
|
|
driver uses.
|
2003-03-30 00:25:23 +00:00
|
|
|
.Pp
|
2003-05-30 21:13:32 +00:00
|
|
|
The arguments are as follows:
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Fa dev
|
|
|
|
The device to set the resource on.
|
|
|
|
.It Fa type
|
|
|
|
The type of resource you want to allocate.
|
2003-03-30 00:25:23 +00:00
|
|
|
It is one of:
|
2003-05-30 21:13:32 +00:00
|
|
|
.Pp
|
|
|
|
.Bl -tag -width ".Dv SYS_RES_MEMORY" -compact
|
2003-03-30 00:25:23 +00:00
|
|
|
.It Dv SYS_RES_IRQ
|
|
|
|
for IRQs
|
|
|
|
.It Dv SYS_RES_DRQ
|
|
|
|
for ISA DMA lines
|
|
|
|
.It Dv SYS_RES_IOPORT
|
|
|
|
for I/O ports
|
|
|
|
.It Dv SYS_RES_MEMORY
|
|
|
|
for I/O memory
|
|
|
|
.El
|
2003-05-30 21:13:32 +00:00
|
|
|
.It Fa rid
|
2004-02-22 00:29:04 +00:00
|
|
|
A bus-specific handle that identifies the resource being allocated.
|
2003-05-30 21:13:32 +00:00
|
|
|
.It Fa start
|
|
|
|
The start address of this resource.
|
|
|
|
.It Fa count
|
|
|
|
The length of the resource.
|
2004-01-27 06:04:15 +00:00
|
|
|
For example, the size of the memory in bytes.
|
2003-03-30 00:25:23 +00:00
|
|
|
.El
|
|
|
|
.Sh RETURN VALUES
|
2003-05-30 21:13:32 +00:00
|
|
|
Zero is returned on success, otherwise an error is returned.
|
2003-03-30 00:25:23 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr bus_alloc_resource 9 ,
|
|
|
|
.Xr bus_get_resource 9 ,
|
|
|
|
.Xr device 9 ,
|
|
|
|
.Xr driver 9
|
|
|
|
.Sh AUTHORS
|
2005-06-28 20:15:19 +00:00
|
|
|
This manual page was written by
|
2014-06-26 21:44:30 +00:00
|
|
|
.An Warner Losh Aq Mt imp@FreeBSD.org .
|