summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_bus.c
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2002-03-29 06:42:54 +0000
committermdodd <mdodd@FreeBSD.org>2002-03-29 06:42:54 +0000
commit9e60cd20eb2a9beb63a6fb908920e67cfe637535 (patch)
tree093a1e4a8cb91e8fdf129c9fd598de1e29ff3876 /sys/kern/subr_bus.c
parent3154e5831af5e1f0ea41ef4434b1d8cec5a089f9 (diff)
downloadFreeBSD-src-9e60cd20eb2a9beb63a6fb908920e67cfe637535.zip
FreeBSD-src-9e60cd20eb2a9beb63a6fb908920e67cfe637535.tar.gz
Add resource_list_add_next() which returns the RID for the resource added.
Diffstat (limited to 'sys/kern/subr_bus.c')
-rw-r--r--sys/kern/subr_bus.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index 138b220..7026ae5 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -1136,6 +1136,19 @@ resource_list_free(struct resource_list *rl)
}
}
+int
+resource_list_add_next(struct resource_list *rl, int type,
+ u_long start, u_long end, u_long count)
+{
+ int rid;
+
+ rid = 0;
+ while (resource_list_find(rl, type, rid)) rid++;
+ resource_list_add(rl, type, rid, start, end, count);
+
+ return (rid);
+}
+
void
resource_list_add(struct resource_list *rl, int type, int rid,
u_long start, u_long end, u_long count)
OpenPOWER on IntegriCloud