summaryrefslogtreecommitdiffstats
path: root/sys/sys/rman.h
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-09-24 19:31:10 +0000
committerphk <phk@FreeBSD.org>2005-09-24 19:31:10 +0000
commit538e3ae81de8e4fe6309c209a04c7d4ec476af05 (patch)
tree5047301813f00a3e55ef4b7ae370fb910aa7f2d8 /sys/sys/rman.h
parentc5182c8c5e1c2a2cb2ff0730db77198b5c832ebc (diff)
downloadFreeBSD-src-538e3ae81de8e4fe6309c209a04c7d4ec476af05.zip
FreeBSD-src-538e3ae81de8e4fe6309c209a04c7d4ec476af05.tar.gz
Add two convenience functions for device drivers: bus_alloc_resources()
and bus_free_resources(). These functions take a list of resources and handle them all in one go. A flag makes it possible to mark a resource as optional. A typical device driver can save 10-30 lines of code by using these. Usage examples will follow RSN. MFC: A good idea, eventually.
Diffstat (limited to 'sys/sys/rman.h')
-rw-r--r--sys/sys/rman.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/rman.h b/sys/sys/rman.h
index c043e80..857a5c8 100644
--- a/sys/sys/rman.h
+++ b/sys/sys/rman.h
@@ -46,6 +46,7 @@
#define RF_WANTED 0x0010 /* somebody is waiting for this resource */
#define RF_FIRSTSHARE 0x0020 /* first in sharing list */
#define RF_PREFETCHABLE 0x0040 /* resource is prefetchable */
+#define RF_OPTIONAL 0x0080 /* for bus_alloc_resources() */
#define RF_ALIGNMENT_SHIFT 10 /* alignment size bit starts bit 10 */
#define RF_ALIGNMENT_MASK (0x003F << RF_ALIGNMENT_SHIFT)
OpenPOWER on IntegriCloud