diff options
Diffstat (limited to 'sys/sys')
-rw-r--r-- | sys/sys/bus.h | 15 | ||||
-rw-r--r-- | sys/sys/rman.h | 1 | ||||
-rw-r--r-- | sys/sys/types.h | 1 |
3 files changed, 12 insertions, 5 deletions
diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 6fc77b4..8216eda 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -85,11 +85,6 @@ void devctl_notify(const char *__system, const char *__subsystem, const char *__type, const char *__data); void devctl_queue_data(char *__data); -/* - * Forward declarations - */ -typedef struct device *device_t; - /** * @brief A device driver (included mainly for compatibility with * FreeBSD 4.x). @@ -294,6 +289,16 @@ int bus_generic_write_ivar(device_t dev, device_t child, int which, * Wrapper functions for the BUS_*_RESOURCE methods to make client code * a little simpler. */ + +struct resource_spec { + int type; + int rid; + int flags; +}; + +int bus_alloc_resources(device_t dev, struct resource_spec *rs, struct resource **res); +void bus_release_resources(device_t dev, struct resource_spec *rs, struct resource **res); + struct resource *bus_alloc_resource(device_t dev, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); 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) diff --git a/sys/sys/types.h b/sys/sys/types.h index 5a0951c..fa1e0bd 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -285,6 +285,7 @@ typedef __uint32_t intrmask_t; /* Interrupt mask (spl, xxx_imask...) */ typedef __uintfptr_t uintfptr_t; typedef __uint64_t uoff_t; typedef struct vm_page *vm_page_t; +typedef struct device *device_t; #define offsetof(type, field) __offsetof(type, field) |