subr_bus.c (e4cd31dd3c7adc94a486ca5309c7096f81fa70f1) subr_bus.c (85ee63c9238483c787a12547328a6b1c196264db)
1/*-
2 * Copyright (c) 1997,1998,2003 Doug Rabson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 3632 unchanged lines hidden (view full) ---

3641{
3642 /* Propagate up the bus hierarchy until someone handles it. */
3643 if (dev->parent)
3644 return (BUS_TEARDOWN_INTR(dev->parent, child, irq, cookie));
3645 return (EINVAL);
3646}
3647
3648/**
1/*-
2 * Copyright (c) 1997,1998,2003 Doug Rabson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 3632 unchanged lines hidden (view full) ---

3641{
3642 /* Propagate up the bus hierarchy until someone handles it. */
3643 if (dev->parent)
3644 return (BUS_TEARDOWN_INTR(dev->parent, child, irq, cookie));
3645 return (EINVAL);
3646}
3647
3648/**
3649 * @brief Helper function for implementing BUS_ADJUST_RESOURCE().
3650 *
3651 * This simple implementation of BUS_ADJUST_RESOURCE() simply calls the
3652 * BUS_ADJUST_RESOURCE() method of the parent of @p dev.
3653 */
3654int
3655bus_generic_adjust_resource(device_t dev, device_t child, int type,
3656 struct resource *r, u_long start, u_long end)
3657{
3658 /* Propagate up the bus hierarchy until someone handles it. */
3659 if (dev->parent)
3660 return (BUS_ADJUST_RESOURCE(dev->parent, child, type, r, start,
3661 end));
3662 return (EINVAL);
3663}
3664
3665/**
3649 * @brief Helper function for implementing BUS_ALLOC_RESOURCE().
3650 *
3651 * This simple implementation of BUS_ALLOC_RESOURCE() simply calls the
3652 * BUS_ALLOC_RESOURCE() method of the parent of @p dev.
3653 */
3654struct resource *
3655bus_generic_alloc_resource(device_t dev, device_t child, int type, int *rid,
3656 u_long start, u_long end, u_long count, u_int flags)

--- 314 unchanged lines hidden (view full) ---

3971{
3972 if (dev->parent == NULL)
3973 return (NULL);
3974 return (BUS_ALLOC_RESOURCE(dev->parent, dev, type, rid, start, end,
3975 count, flags));
3976}
3977
3978/**
3666 * @brief Helper function for implementing BUS_ALLOC_RESOURCE().
3667 *
3668 * This simple implementation of BUS_ALLOC_RESOURCE() simply calls the
3669 * BUS_ALLOC_RESOURCE() method of the parent of @p dev.
3670 */
3671struct resource *
3672bus_generic_alloc_resource(device_t dev, device_t child, int type, int *rid,
3673 u_long start, u_long end, u_long count, u_int flags)

--- 314 unchanged lines hidden (view full) ---

3988{
3989 if (dev->parent == NULL)
3990 return (NULL);
3991 return (BUS_ALLOC_RESOURCE(dev->parent, dev, type, rid, start, end,
3992 count, flags));
3993}
3994
3995/**
3996 * @brief Wrapper function for BUS_ADJUST_RESOURCE().
3997 *
3998 * This function simply calls the BUS_ADJUST_RESOURCE() method of the
3999 * parent of @p dev.
4000 */
4001int
4002bus_adjust_resource(device_t dev, int type, struct resource *r, u_long start,
4003 u_long end)
4004{
4005 if (dev->parent == NULL)
4006 return (EINVAL);
4007 return (BUS_ADJUST_RESOURCE(dev->parent, dev, type, r, start, end));
4008}
4009
4010/**
3979 * @brief Wrapper function for BUS_ACTIVATE_RESOURCE().
3980 *
3981 * This function simply calls the BUS_ACTIVATE_RESOURCE() method of the
3982 * parent of @p dev.
3983 */
3984int
3985bus_activate_resource(device_t dev, int type, int rid, struct resource *r)
3986{

--- 724 unchanged lines hidden ---
4011 * @brief Wrapper function for BUS_ACTIVATE_RESOURCE().
4012 *
4013 * This function simply calls the BUS_ACTIVATE_RESOURCE() method of the
4014 * parent of @p dev.
4015 */
4016int
4017bus_activate_resource(device_t dev, int type, int rid, struct resource *r)
4018{

--- 724 unchanged lines hidden ---