Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/bus_adjust_resource.9
Show All 19 Lines | |||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" 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 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.Dd April 23, 2016 | .Dd March 13, 2024 | ||||
emaste: bump on commit, of course | |||||
.Dt BUS_ADJUST_RESOURCE 9 | .Dt BUS_ADJUST_RESOURCE 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm bus_adjust_resource | .Nm bus_adjust_resource | ||||
.Nd adjust resource allocated from a parent bus | .Nd adjust resource allocated from a parent bus | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/param.h | .In sys/param.h | ||||
.In sys/bus.h | .In sys/bus.h | ||||
.Pp | .Pp | ||||
.In machine/bus.h | .In machine/bus.h | ||||
.In sys/rman.h | .In sys/rman.h | ||||
.In machine/resource.h | .In machine/resource.h | ||||
.Ft int | .Ft int | ||||
.Fo bus_adjust_resource | .Fo bus_adjust_resource | ||||
.Fa "device_t dev" "int type" "struct resource *r" | .Fa "device_t dev" "struct resource *r" | ||||
.Fa "rman_res_t start" "rman_res_t end" | .Fa "rman_res_t start" "rman_res_t end" | ||||
.Fc | .Fc | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
This function is used to ask the parent bus to adjust the resource range | This function is used to ask the parent bus to adjust the resource range | ||||
assigned to an allocated resource. | assigned to an allocated resource. | ||||
The resource | The resource | ||||
.Fa r | .Fa r | ||||
should have been allocated by a previous call to | should have been allocated by a previous call to | ||||
.Xr bus_alloc_resource 9 . | .Xr bus_alloc_resource 9 . | ||||
The new resource range must overlap the existing range of | The new resource range must overlap the existing range of | ||||
.Fa r . | .Fa r . | ||||
The | |||||
.Fa type | |||||
argument should match the | |||||
.Fa type | |||||
argument passed to | |||||
.Xr bus_alloc_resource 9 | |||||
when the resource was initially allocated. | |||||
.Pp | .Pp | ||||
Note that none of the constraints of the original allocation request such | Note that none of the constraints of the original allocation request such | ||||
as alignment or boundary restrictions are checked by | as alignment or boundary restrictions are checked by | ||||
.Fn bus_adjust_resource . | .Fn bus_adjust_resource . | ||||
It is the caller's responsibility to enforce any such requirements. | It is the caller's responsibility to enforce any such requirements. | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
The | The | ||||
.Fn bus_adjust_resource | .Fn bus_adjust_resource | ||||
method returns zero on success or an error code on failure. | method returns zero on success or an error code on failure. | ||||
.Sh EXAMPLES | .Sh EXAMPLES | ||||
Grow an existing memory resource by 4096 bytes. | Grow an existing memory resource by 4096 bytes. | ||||
.Bd -literal | .Bd -literal | ||||
struct resource *res; | struct resource *res; | ||||
int error; | int error; | ||||
error = bus_adjust_resource(dev, SYS_RES_MEMORY, res, | error = bus_adjust_resource(dev, res, rman_get_start(res), | ||||
rman_get_start(res), rman_get_end(res) + 0x1000); | rman_get_end(res) + 0x1000); | ||||
.Ed | .Ed | ||||
.Sh ERRORS | .Sh ERRORS | ||||
.Fn bus_adjust_resource | .Fn bus_adjust_resource | ||||
will fail if: | will fail if: | ||||
.Bl -tag -width Er | .Bl -tag -width Er | ||||
.It Bq Er EINVAL | .It Bq Er EINVAL | ||||
The | The | ||||
.Fa dev | .Fa dev | ||||
Show All 16 Lines |
bump on commit, of course