summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2006-06-12 04:06:21 +0000
committerWarner Losh <imp@FreeBSD.org>2006-06-12 04:06:21 +0000
commitccdc8d9bffdc66f988de20f75c70d2fcb7fca5b6 (patch)
treeb787b2029f45b61dc83245fb51c58663ad47973d /sys
parentd47f76464aa47e56205eff70a55567313a3cfde1 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/subr_rman.c10
-rw-r--r--sys/sys/rman.h3
2 files changed, 12 insertions, 1 deletions
diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c
index f5bfd5bc2c70..ce6592ea4d58 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;
diff --git a/sys/sys/rman.h b/sys/sys/rman.h
index e7831707ec35..ba06cc043cb6 100644
--- a/sys/sys/rman.h
+++ b/sys/sys/rman.h
@@ -35,7 +35,7 @@
#ifndef _KERNEL
#include <sys/queue.h>
#else
-#include <machine/bus.h>
+#include <machine/_bus.h>
#include <machine/resource.h>
#endif
@@ -129,6 +129,7 @@ void *rman_get_virtual(struct resource *);
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);
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);