diff options
author | jhb <jhb@FreeBSD.org> | 2011-04-29 21:36:45 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2011-04-29 21:36:45 +0000 |
commit | deafe4e5935414f3eecacab7035e974aed41f689 (patch) | |
tree | a10e3ccb13df7df7d9773ae454c4eab95b57171c /sys/kern/bus_if.m | |
parent | f99737eb7bcd6c02fdf8bafc61179eb2711a4ed7 (diff) | |
download | FreeBSD-src-deafe4e5935414f3eecacab7035e974aed41f689.zip FreeBSD-src-deafe4e5935414f3eecacab7035e974aed41f689.tar.gz |
Add a new bus method, BUS_ADJUST_RESOURCE() that is intended to be a
wrapper around rman_adjust_resource(). Include a generic implementation,
bus_generic_adjust_resource() which passes the request up to the parent
bus. There is currently no default implementation. A
bus_adjust_resource() wrapper is provided for use in drivers.
Diffstat (limited to 'sys/kern/bus_if.m')
-rw-r--r-- | sys/kern/bus_if.m | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/kern/bus_if.m b/sys/kern/bus_if.m index de808de..96fbda8 100644 --- a/sys/kern/bus_if.m +++ b/sys/kern/bus_if.m @@ -297,6 +297,30 @@ METHOD int deactivate_resource { }; /** + * @brief Adjust a resource + * + * Adjust the start and/or end of a resource allocated by + * BUS_ALLOC_RESOURCE. At least part of the new address range must overlap + * with the existing address range. If the successful, the resource's range + * will be adjusted to [start, end] on return. + * + * @param _dev the parent device of @p _child + * @param _child the device which allocated the resource + * @param _type the type of resource + * @param _res the resource to adjust + * @param _start the new starting address of the resource range + * @param _end the new ending address of the resource range + */ +METHOD int adjust_resource { + device_t _dev; + device_t _child; + int _type; + struct resource *_res; + u_long _start; + u_long _end; +}; + +/** * @brief Release a resource * * Free a resource allocated by the BUS_ALLOC_RESOURCE. The @p _rid |