summaryrefslogtreecommitdiffstats
path: root/sys/sys/rman.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2011-04-29 20:05:19 +0000
committerjhb <jhb@FreeBSD.org>2011-04-29 20:05:19 +0000
commit22b381b7217c2644a04f90b803d07661633ac04c (patch)
tree68553f76dd359b9f2d5933c94bc812021fc6bf4c /sys/sys/rman.h
parent08955ceac0e6a5e070d655c0f47e170747a075d7 (diff)
downloadFreeBSD-src-22b381b7217c2644a04f90b803d07661633ac04c.zip
FreeBSD-src-22b381b7217c2644a04f90b803d07661633ac04c.tar.gz
Extend the rman(9) API to support altering an existing resource.
Specifically, these changes allow a resource to back a relocatable and resizable resource such as the I/O window decoders in PCI-PCI bridges. - rman_adjust_resource() can adjust the start and end address of an existing resource. It only succeeds if the newly requested address space is already free. It also supports shrinking a resource in which case the freed space will be marked unallocated in the rman. - rman_first_free_region() and rman_last_free_region() return the start and end addresses for the first or last unallocated region in an rman, respectively. This can be used to determine by how much the resource backing an rman must be adjusted to accomodate an allocation request that does not fit into the existing rman. While here, document the rm_start and rm_end fields in struct rman, rman_is_region_manager(), the bound argument to rman_reserve_resource_bound(), and rman_init_from_resource().
Diffstat (limited to 'sys/sys/rman.h')
-rw-r--r--sys/sys/rman.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/sys/rman.h b/sys/sys/rman.h
index ba06cc0..b34ef37 100644
--- a/sys/sys/rman.h
+++ b/sys/sys/rman.h
@@ -116,7 +116,9 @@ struct rman {
TAILQ_HEAD(rman_head, rman);
int rman_activate_resource(struct resource *r);
+int rman_adjust_resource(struct resource *r, u_long start, u_long end);
int rman_await_resource(struct resource *r, int pri, int timo);
+int rman_first_free_region(struct rman *rm, u_long *start, u_long *end);
bus_space_handle_t rman_get_bushandle(struct resource *);
bus_space_tag_t rman_get_bustag(struct resource *);
u_long rman_get_end(struct resource *);
@@ -130,6 +132,7 @@ int rman_deactivate_resource(struct resource *r);
int rman_fini(struct rman *rm);
int rman_init(struct rman *rm);
int rman_init_from_resource(struct rman *rm, struct resource *r);
+int rman_last_free_region(struct rman *rm, u_long *start, u_long *end);
uint32_t rman_make_alignment_flags(uint32_t size);
int rman_manage_region(struct rman *rm, u_long start, u_long end);
int rman_is_region_manager(struct resource *r, struct rman *rm);
OpenPOWER on IntegriCloud