diff options
author | jhibbits <jhibbits@FreeBSD.org> | 2016-02-27 03:35:28 +0000 |
---|---|---|
committer | jhibbits <jhibbits@FreeBSD.org> | 2016-02-27 03:35:28 +0000 |
commit | 8db64542512568b735293ebaad1c652c899a02f1 (patch) | |
tree | 973001bd07c056ca7c10f23894d1ed692af0e054 /share | |
parent | a299546def9ced6d3125373164a42978f6f56f5b (diff) | |
download | FreeBSD-src-8db64542512568b735293ebaad1c652c899a02f1.zip FreeBSD-src-8db64542512568b735293ebaad1c652c899a02f1.tar.gz |
Add the bus_alloc_resource_anywhere() convenience function.
Summary:
Many instances of bus_alloc_resource() simply use 0 and ~0 for start and end to
denote 'anywhere' with a given count. To clean this up, introduce a
bus_alloc_resource_anywhere() convenience function.
Bump __FreeBSD_version for the new API.
Reviewed By: jhb
Differential Revision: https://reviews.freebsd.org/D5370
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man9/bus_alloc_resource.9 | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/share/man/man9/bus_alloc_resource.9 b/share/man/man9/bus_alloc_resource.9 index d579f9a..92c589d 100644 --- a/share/man/man9/bus_alloc_resource.9 +++ b/share/man/man9/bus_alloc_resource.9 @@ -34,6 +34,7 @@ .Sh NAME .Nm bus_alloc_resource , .Nm bus_alloc_resource_any +.Nm bus_alloc_resource_anywhere .Nd allocate resources from a parent bus .Sh SYNOPSIS .In sys/param.h @@ -49,6 +50,10 @@ .Fc .Ft struct resource * .Fn bus_alloc_resource_any "device_t dev" "int type" "int *rid" "u_int flags" +.Fc +.Ft struct resource * +.Fn bus_alloc_resource_anywhere +.Fa "device_t dev" "int type" "int *rid" "rman_res_t count" "u_int flags" .Sh DESCRIPTION This is an easy interface to the resource-management functions. It hides the indirection through the parent's method table. @@ -57,9 +62,12 @@ rare cases) never earlier. .Pp The .Fn bus_alloc_resource_any -function is a convenience wrapper for +and +.Fn bus_alloc_resource_anywhere +functions are convenience wrappers for .Fn bus_alloc_resource . -It sets the values for +.Fn bus_alloc_resource_any +sets .Fa start , .Fa end , and @@ -67,6 +75,14 @@ and to the default resource (see description of .Fa start below). +.Fn bus_alloc_resource_anywhere +sets +.Fa start +and +.Fa end +to the default resource and uses the provided +.Fa count +argument. .Pp The arguments are as follows: .Bl -item |