summaryrefslogtreecommitdiffstats
path: root/sys/sys/bus.h
diff options
context:
space:
mode:
authorjhibbits <jhibbits@FreeBSD.org>2016-02-27 03:35:28 +0000
committerjhibbits <jhibbits@FreeBSD.org>2016-02-27 03:35:28 +0000
commit8db64542512568b735293ebaad1c652c899a02f1 (patch)
tree973001bd07c056ca7c10f23894d1ed692af0e054 /sys/sys/bus.h
parenta299546def9ced6d3125373164a42978f6f56f5b (diff)
downloadFreeBSD-src-8db64542512568b735293ebaad1c652c899a02f1.zip
FreeBSD-src-8db64542512568b735293ebaad1c652c899a02f1.tar.gz
Add the bus_alloc_resource_anywhere() convenience function.
Summary: Many instances of bus_alloc_resource() simply use 0 and ~0 for start and end to denote 'anywhere' with a given count. To clean this up, introduce a bus_alloc_resource_anywhere() convenience function. Bump __FreeBSD_version for the new API. Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D5370
Diffstat (limited to 'sys/sys/bus.h')
-rw-r--r--sys/sys/bus.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index 15f5c06..0e408446 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -481,6 +481,13 @@ bus_alloc_resource_any(device_t dev, int type, int *rid, u_int flags)
return (bus_alloc_resource(dev, type, rid, 0ul, ~0ul, 1, flags));
}
+static __inline struct resource *
+bus_alloc_resource_anywhere(device_t dev, int type, int *rid,
+ rman_res_t count, u_int flags)
+{
+ return (bus_alloc_resource(dev, type, rid, 0ul, ~0ul, count, flags));
+}
+
/*
* Access functions for device.
*/
OpenPOWER on IntegriCloud