diff options
author | dim <dim@FreeBSD.org> | 2016-02-21 13:49:26 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2016-02-21 13:49:26 +0000 |
commit | 2e1a0cbbd8f5a5ca7ec73c85311451ed1ac4242c (patch) | |
tree | bb5f550a5fd2ee1357495987f5076839273e5998 /sys/kern/subr_bus.c | |
parent | f393760a8a7c87242739a64002290b7bda94cb27 (diff) | |
parent | 579b7ad49fdbcb4dd1e016603c5d0774b32c12d1 (diff) | |
download | FreeBSD-src-2e1a0cbbd8f5a5ca7ec73c85311451ed1ac4242c.zip FreeBSD-src-2e1a0cbbd8f5a5ca7ec73c85311451ed1ac4242c.tar.gz |
Merge ^/head r295601 through r295844.
Diffstat (limited to 'sys/kern/subr_bus.c')
-rw-r--r-- | sys/kern/subr_bus.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 6aca991..a144031 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -3311,7 +3311,7 @@ resource_list_alloc(struct resource_list *rl, device_t bus, device_t child, { struct resource_list_entry *rle = NULL; int passthrough = (device_get_parent(child) != bus); - int isdefault = (start == 0UL && end == ~0UL); + int isdefault = RMAN_IS_DEFAULT_RANGE(start, end); if (passthrough) { return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, @@ -4095,6 +4095,22 @@ bus_generic_get_dma_tag(device_t dev, device_t child) } /** + * @brief Helper function for implementing BUS_GET_BUS_TAG(). + * + * This simple implementation of BUS_GET_BUS_TAG() simply calls the + * BUS_GET_BUS_TAG() method of the parent of @p dev. + */ +bus_space_tag_t +bus_generic_get_bus_tag(device_t dev, device_t child) +{ + + /* Propagate up the bus hierarchy until someone handles it. */ + if (dev->parent != NULL) + return (BUS_GET_BUS_TAG(dev->parent, child)); + return ((bus_space_tag_t)0); +} + +/** * @brief Helper function for implementing BUS_GET_RESOURCE(). * * This implementation of BUS_GET_RESOURCE() uses the @@ -4576,6 +4592,23 @@ bus_get_dma_tag(device_t dev) } /** + * @brief Wrapper function for BUS_GET_BUS_TAG(). + * + * This function simply calls the BUS_GET_BUS_TAG() method of the + * parent of @p dev. + */ +bus_space_tag_t +bus_get_bus_tag(device_t dev) +{ + device_t parent; + + parent = device_get_parent(dev); + if (parent == NULL) + return ((bus_space_tag_t)0); + return (BUS_GET_BUS_TAG(parent, dev)); +} + +/** * @brief Wrapper function for BUS_GET_DOMAIN(). * * This function simply calls the BUS_GET_DOMAIN() method of the |