Changeset View
Changeset View
Standalone View
Standalone View
head/share/man/man9/bus_activate_resource.9
Show All 22 Lines | |||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd May 10, 2016 | .Dd May 20, 2016 | ||||
.Dt BUS_ACTIVATE_RESOURCE 9 | .Dt BUS_ACTIVATE_RESOURCE 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm bus_activate_resource , bus_deactivate_resource | .Nm bus_activate_resource , bus_deactivate_resource | ||||
.Nd activate or deactivate a resource | .Nd activate or deactivate a resource | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/param.h | .In sys/param.h | ||||
.In sys/bus.h | .In sys/bus.h | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
These can be used with the | These can be used with the | ||||
.Xr bus_space 9 | .Xr bus_space 9 | ||||
API to access device registers or memory described by | API to access device registers or memory described by | ||||
.Fa r . | .Fa r . | ||||
If the mapping is associated with a virtual address, | If the mapping is associated with a virtual address, | ||||
the virtual address can be retrieved via | the virtual address can be retrieved via | ||||
.Xr rman_get_virtual 9 . | .Xr rman_get_virtual 9 . | ||||
.Pp | .Pp | ||||
This implicit mapping can be disabled by passing the | |||||
.Dv RF_UNMAPPED | |||||
flag to | |||||
.Xr bus_alloc_resource 9 . | |||||
A driver may use this if it wishes to allocate its own mappings of a resource | |||||
using | |||||
.Xr bus_map_resource 9 . | |||||
.Pp | |||||
A wrapper API for | A wrapper API for | ||||
.Xr bus_space 9 | .Xr bus_space 9 | ||||
is also provided that accepts the associated resource as the first argument | is also provided that accepts the associated resource as the first argument | ||||
in place of the | in place of the | ||||
.Xr bus_space 9 | .Xr bus_space 9 | ||||
tag and handle. | tag and handle. | ||||
The functions in this wrapper API are named similarly to the | The functions in this wrapper API are named similarly to the | ||||
.Xr bus_space 9 | .Xr bus_space 9 | ||||
Show All 11 Lines | |||||
.Bd -literal | .Bd -literal | ||||
bus_space_read_4(rman_get_bustag(res), rman_get_bushandle(res), 0); | bus_space_read_4(rman_get_bustag(res), rman_get_bushandle(res), 0); | ||||
bus_read_4(res, 0); | bus_read_4(res, 0); | ||||
.Ed | .Ed | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
Zero is returned on success, otherwise an error is returned. | Zero is returned on success, otherwise an error is returned. | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr bus_alloc_resource 9 , | .Xr bus_alloc_resource 9 , | ||||
.Xr bus_map_resource 9 , | |||||
.Xr bus_space 9 , | .Xr bus_space 9 , | ||||
.Xr device 9 , | .Xr device 9 , | ||||
.Xr driver 9 | .Xr driver 9 | ||||
.Sh AUTHORS | .Sh AUTHORS | ||||
This manual page was written by | This manual page was written by | ||||
.An Warner Losh Aq Mt imp@FreeBSD.org . | .An Warner Losh Aq Mt imp@FreeBSD.org . |