xref: /freebsd/share/man/man9/bus_set_resource.9 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1d082b089SWarner Losh.\" -*- nroff -*-
2d082b089SWarner Losh.\"
3*a339dcccSWarner Losh.\" Copyright (c) 2003 M. Warner Losh <imp@FreeBSD.org>
4d082b089SWarner Losh.\"
5d082b089SWarner Losh.\" Redistribution and use in source and binary forms, with or without
6d082b089SWarner Losh.\" modification, are permitted provided that the following conditions
7d082b089SWarner Losh.\" are met:
8d082b089SWarner Losh.\" 1. Redistributions of source code must retain the above copyright
9d082b089SWarner Losh.\"    notice, this list of conditions and the following disclaimer.
10d082b089SWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright
11d082b089SWarner Losh.\"    notice, this list of conditions and the following disclaimer in the
12d082b089SWarner Losh.\"    documentation and/or other materials provided with the distribution.
13d082b089SWarner Losh.\"
14d082b089SWarner Losh.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
15d082b089SWarner Losh.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16d082b089SWarner Losh.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17d082b089SWarner Losh.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
18d082b089SWarner Losh.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19d082b089SWarner Losh.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20d082b089SWarner Losh.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21d082b089SWarner Losh.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22d082b089SWarner Losh.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23d082b089SWarner Losh.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24d082b089SWarner Losh.\"
25d082b089SWarner Losh.Dd March 29, 2003
26d082b089SWarner Losh.Dt BUS_SET_RESOURCE 9
27d082b089SWarner Losh.Os
28d082b089SWarner Losh.Sh NAME
29d082b089SWarner Losh.Nm bus_set_resource
303e1cee04SRuslan Ermilov.Nd "associate a definite resource with a given resource ID"
31d082b089SWarner Losh.Sh SYNOPSIS
32d082b089SWarner Losh.In sys/param.h
33d082b089SWarner Losh.In sys/bus.h
34d082b089SWarner Losh.Pp
35d082b089SWarner Losh.In machine/bus.h
36d082b089SWarner Losh.In sys/rman.h
37d082b089SWarner Losh.In machine/resource.h
38d082b089SWarner Losh.Ft int
393e1cee04SRuslan Ermilov.Fo bus_set_resource
402dd1bdf1SJustin Hibbits.Fa "device_t dev" "int type" "int rid" "rman_res_t start" "rman_res_t count"
413e1cee04SRuslan Ermilov.Fc
42d082b089SWarner Losh.Sh DESCRIPTION
433e1cee04SRuslan ErmilovThe
443e1cee04SRuslan Ermilov.Fn bus_set_resource
453e1cee04SRuslan Ermilovfunction
463e1cee04SRuslan Ermilovsets the start address of the resource
473e1cee04SRuslan Ermilov.Fa type , rid
483e1cee04SRuslan Ermilovpair to be
493e1cee04SRuslan Ermilov.Fa count
503e1cee04SRuslan Ermilovlong.
513e1cee04SRuslan ErmilovTypically, client drivers do not use this interface.
52d082b089SWarner LoshBus drivers, however, often use it to set up the resources a client
533e1cee04SRuslan Ermilovdriver uses.
54d082b089SWarner Losh.Pp
553e1cee04SRuslan ErmilovThe arguments are as follows:
563e1cee04SRuslan Ermilov.Bl -tag -width indent
573e1cee04SRuslan Ermilov.It Fa dev
583e1cee04SRuslan ErmilovThe device to set the resource on.
593e1cee04SRuslan Ermilov.It Fa type
603e1cee04SRuslan ErmilovThe type of resource you want to allocate.
61d082b089SWarner LoshIt is one of:
623e1cee04SRuslan Ermilov.Pp
633e1cee04SRuslan Ermilov.Bl -tag -width ".Dv SYS_RES_MEMORY" -compact
64d082b089SWarner Losh.It Dv SYS_RES_IRQ
65d082b089SWarner Loshfor IRQs
66d082b089SWarner Losh.It Dv SYS_RES_DRQ
67d082b089SWarner Loshfor ISA DMA lines
68d082b089SWarner Losh.It Dv SYS_RES_IOPORT
69d082b089SWarner Loshfor I/O ports
70d082b089SWarner Losh.It Dv SYS_RES_MEMORY
71d082b089SWarner Loshfor I/O memory
72d082b089SWarner Losh.El
733e1cee04SRuslan Ermilov.It Fa rid
743c8c0646SNate LawsonA bus-specific handle that identifies the resource being allocated.
753e1cee04SRuslan Ermilov.It Fa start
763e1cee04SRuslan ErmilovThe start address of this resource.
773e1cee04SRuslan Ermilov.It Fa count
783e1cee04SRuslan ErmilovThe length of the resource.
79ba4594dcSNate LawsonFor example, the size of the memory in bytes.
80d082b089SWarner Losh.El
81d082b089SWarner Losh.Sh RETURN VALUES
823e1cee04SRuslan ErmilovZero is returned on success, otherwise an error is returned.
83d082b089SWarner Losh.Sh SEE ALSO
84d082b089SWarner Losh.Xr bus_alloc_resource 9 ,
85d082b089SWarner Losh.Xr bus_get_resource 9 ,
86d082b089SWarner Losh.Xr device 9 ,
87d082b089SWarner Losh.Xr driver 9
88d082b089SWarner Losh.Sh AUTHORS
89571dba6eSHiten PandyaThis manual page was written by
908a7314fcSBaptiste Daroussin.An Warner Losh Aq Mt imp@FreeBSD.org .
91