summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_rman.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2006-06-12 04:06:21 +0000
committerimp <imp@FreeBSD.org>2006-06-12 04:06:21 +0000
commita157e1bbd0c955886069274aa528323af2434ed7 (patch)
treeb787b2029f45b61dc83245fb51c58663ad47973d /sys/kern/subr_rman.c
parent3182791d17323e2d73cc6bff321e1c6a6210a399 (diff)
downloadFreeBSD-src-a157e1bbd0c955886069274aa528323af2434ed7.zip
FreeBSD-src-a157e1bbd0c955886069274aa528323af2434ed7.tar.gz
Add a convenience function rman_init_from_resource for initializing
a rman from a resource. Also, include _bus.h since the implementation of bus_space isn't needed here, just the definitions of the types.
Diffstat (limited to 'sys/kern/subr_rman.c')
-rw-r--r--sys/kern/subr_rman.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c
index f5bfd5b..ce6592e 100644
--- a/sys/kern/subr_rman.c
+++ b/sys/kern/subr_rman.c
@@ -183,6 +183,16 @@ rman_manage_region(struct rman *rm, u_long start, u_long end)
}
int
+rman_init_from_resource(struct rman *rm, struct resource *r)
+{
+ int rv;
+
+ if ((rv = rman_init(rm)) != 0)
+ return (rv);
+ return (rman_manage_region(rm, r->__r_i->r_start, r->__r_i->r_end));
+}
+
+int
rman_fini(struct rman *rm)
{
struct resource_i *r;
OpenPOWER on IntegriCloud