From 538e3ae81de8e4fe6309c209a04c7d4ec476af05 Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 24 Sep 2005 19:31:10 +0000 Subject: 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. --- sys/sys/rman.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/sys/rman.h') 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) -- cgit v1.1