1ec33f2d5SWarner Losh.\" -*- nroff -*- 2ec33f2d5SWarner Losh.\" 3ec33f2d5SWarner Losh.\" Copyright (c) 2003 M. Warner Losh 4ec33f2d5SWarner Losh.\" 5ec33f2d5SWarner Losh.\" All rights reserved. 6ec33f2d5SWarner Losh.\" 7ec33f2d5SWarner Losh.\" This program is free software. 8ec33f2d5SWarner Losh.\" 9ec33f2d5SWarner Losh.\" Redistribution and use in source and binary forms, with or without 10ec33f2d5SWarner Losh.\" modification, are permitted provided that the following conditions 11ec33f2d5SWarner Losh.\" are met: 12ec33f2d5SWarner Losh.\" 1. Redistributions of source code must retain the above copyright 13ec33f2d5SWarner Losh.\" notice, this list of conditions and the following disclaimer. 14ec33f2d5SWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright 15ec33f2d5SWarner Losh.\" notice, this list of conditions and the following disclaimer in the 16ec33f2d5SWarner Losh.\" documentation and/or other materials provided with the distribution. 17ec33f2d5SWarner Losh.\" 18ec33f2d5SWarner Losh.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR 19ec33f2d5SWarner Losh.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20ec33f2d5SWarner Losh.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21ec33f2d5SWarner Losh.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 22ec33f2d5SWarner Losh.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23ec33f2d5SWarner Losh.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24ec33f2d5SWarner Losh.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25ec33f2d5SWarner Losh.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26ec33f2d5SWarner Losh.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27ec33f2d5SWarner Losh.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28ec33f2d5SWarner Losh.\" 29ec33f2d5SWarner Losh.\" $FreeBSD$ 30ec33f2d5SWarner Losh.\" 31ec33f2d5SWarner Losh.Dd March 28, 2003 32ec33f2d5SWarner Losh.Dt BUS_ACTIVATE_RESOURCE 9 33ec33f2d5SWarner Losh.Os 34ec33f2d5SWarner Losh.Sh NAME 35ec33f2d5SWarner Losh.Nm bus_activate_resource, bus_deactivate_resources 36ec33f2d5SWarner Losh.Nd activates or deactivates a resources 37ec33f2d5SWarner Losh.Sh SYNOPSIS 38ec33f2d5SWarner Losh.In sys/param.h 39ec33f2d5SWarner Losh.In sys/bus.h 40ec33f2d5SWarner Losh.Pp 41ec33f2d5SWarner Losh.In machine/bus.h 42ec33f2d5SWarner Losh.In sys/rman.h 43ec33f2d5SWarner Losh.In machine/resource.h 44ec33f2d5SWarner Losh.Ft int 45ec33f2d5SWarner Losh.Fn bus_activate_resource "device_t dev" "int type" "int *rid" "struct resource *r" 46ec33f2d5SWarner Losh.Ft int 47ec33f2d5SWarner Losh.Fn bus_deactivate_resource "device_t dev" "int type" "int *rid" "struct resource *r" 48ec33f2d5SWarner Losh.Sh DESCRIPTION 49ec33f2d5SWarner LoshActivates or deactivates a previously allocated resource. 50ec33f2d5SWarner LoshIn general, resources must be activated before they can be accessed by 51ec33f2d5SWarner Loshthe driver so that the bus driver can map the resource into the 52ec33f2d5SWarner Loshdevices space. 53ec33f2d5SWarner Losh.Pp 54ec33f2d5SWarner LoshIts arguments are as follows: 55ec33f2d5SWarner Losh.Bl -item 56ec33f2d5SWarner Losh.It 57ec33f2d5SWarner Losh.Fa dev 58ec33f2d5SWarner Loshis the device that requests ownership of the resource. 59ec33f2d5SWarner LoshBefore allocation, the resource is owned by the parent bus. 60ec33f2d5SWarner Losh.It 61ec33f2d5SWarner Losh.Fa type 62ec33f2d5SWarner Loshis the type of resource you want to allocate. 63ec33f2d5SWarner LoshIt is one of: 64ec33f2d5SWarner Losh.Bl -tag -width SYS_RES_MEMORY 65ec33f2d5SWarner Losh.It Dv SYS_RES_IRQ 66ec33f2d5SWarner Loshfor IRQs 67ec33f2d5SWarner Losh.It Dv SYS_RES_DRQ 68ec33f2d5SWarner Loshfor ISA DMA lines 69ec33f2d5SWarner Losh.It Dv SYS_RES_IOPORT 70ec33f2d5SWarner Loshfor I/O ports 71ec33f2d5SWarner Losh.It Dv SYS_RES_MEMORY 72ec33f2d5SWarner Loshfor I/O memory 73ec33f2d5SWarner Losh.El 74ec33f2d5SWarner Losh.It 75ec33f2d5SWarner Losh.Fa rid 76ec33f2d5SWarner Loshpoints to a bus specific handle that identifies the resource being allocated. 77ec33f2d5SWarner Losh.It 78ec33f2d5SWarner Losh.Fa r 79ec33f2d5SWarner Loshpoints to the 80ec33f2d5SWarner Losh.Ft struct resource 81ec33f2d5SWarner Loshreturned by 82ec33f2d5SWarner Losh.Xr bus_alloc_resource 9 . 83ec33f2d5SWarner Losh.El 84ec33f2d5SWarner Losh.Sh RETURN VALUES 85ec33f2d5SWarner LoshZero indicates success. 86ec33f2d5SWarner LoshNon-zero is an error from errno.h. 87ec33f2d5SWarner Losh.\".Sh EXAMPLES 88ec33f2d5SWarner Losh.\".Bd -literal 89ec33f2d5SWarner Losh.\".Ed 90ec33f2d5SWarner Losh.Sh SEE ALSO 91ec33f2d5SWarner Losh.Xr bus_alloc_resource 9 , 92ec33f2d5SWarner Losh.Xr device 9 , 93ec33f2d5SWarner Losh.Xr driver 9 94ec33f2d5SWarner Losh.Sh AUTHORS 95ec33f2d5SWarner Losh.An -nosplit 96ec33f2d5SWarner LoshThis man page was written by 97ec33f2d5SWarner Losh.An Warner Losh Aq imp@FreeBSD.org . 98