Deleted Added
full compact
subr_bus.c (49047) subr_bus.c (49195)
1/*-
2 * Copyright (c) 1997,1998 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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1997,1998 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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $Id: subr_bus.c,v 1.30 1999/07/11 13:42:37 dfr Exp $
26 * $Id: subr_bus.c,v 1.31 1999/07/24 09:34:12 dfr Exp $
27 */
28
29#include <sys/param.h>
30#include <sys/queue.h>
31#include <sys/malloc.h>
32#include <sys/kernel.h>
33#include <sys/module.h>
34#include <sys/sysctl.h>

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

620 dev->ivars = ivars;
621 dev->softc = NULL;
622
623 dev->state = DS_NOTPRESENT;
624
625 return dev;
626}
627
27 */
28
29#include <sys/param.h>
30#include <sys/queue.h>
31#include <sys/malloc.h>
32#include <sys/kernel.h>
33#include <sys/module.h>
34#include <sys/sysctl.h>

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

620 dev->ivars = ivars;
621 dev->softc = NULL;
622
623 dev->state = DS_NOTPRESENT;
624
625 return dev;
626}
627
628static void
628static int
629device_print_child(device_t dev, device_t child)
630{
629device_print_child(device_t dev, device_t child)
630{
631 printf("%s%d", device_get_name(child), device_get_unit(child));
631 int retval = 0;
632
632 if (device_is_alive(child)) {
633 if (device_is_alive(child)) {
633 if (device_get_desc(child))
634 printf(": <%s>", device_get_desc(child));
635 BUS_PRINT_CHILD(dev, child);
634 retval += BUS_PRINT_CHILD(dev, child);
636 } else
635 } else
637 printf(" not found");
638 printf("\n");
636 retval += device_printf(child, " not found\n");
637
638 return (retval);
639}
640
641device_t
642device_add_child(device_t dev, const char *name, int unit, void *ivars)
643{
644 return device_add_child_ordered(dev, 0, name, unit, ivars);
645}
646

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

1852 for (child = TAILQ_FIRST(&dev->children);
1853 child; child = TAILQ_NEXT(child, link)) {
1854 DEVICE_RESUME(child);
1855 /* if resume fails, there's nothing we can usefully do... */
1856 }
1857 return 0;
1858}
1859
639}
640
641device_t
642device_add_child(device_t dev, const char *name, int unit, void *ivars)
643{
644 return device_add_child_ordered(dev, 0, name, unit, ivars);
645}
646

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

1852 for (child = TAILQ_FIRST(&dev->children);
1853 child; child = TAILQ_NEXT(child, link)) {
1854 DEVICE_RESUME(child);
1855 /* if resume fails, there's nothing we can usefully do... */
1856 }
1857 return 0;
1858}
1859
1860void
1860int
1861bus_print_child_header (device_t dev, device_t child)
1862{
1863 int retval = 0;
1864
1865 if (device_get_desc(child)) {
1866 retval += device_printf(child, "<%s>",
1867 device_get_desc(child));
1868 } else {
1869 retval += printf("%s", device_get_nameunit(child))
1870 }
1871
1872 return (retval);
1873}
1874
1875int
1876bus_print_child_footer (device_t dev, device_t child)
1877{
1878 return(printf(" on %s\n", device_get_nameunit(dev)));
1879}
1880
1881int
1861bus_generic_print_child(device_t dev, device_t child)
1862{
1882bus_generic_print_child(device_t dev, device_t child)
1883{
1863 printf(" on %s%d", device_get_name(dev), device_get_unit(dev));
1884 int retval = 0;
1885
1886 retval += bus_print_child_header(dev, child);
1887 retval += bus_print_child_footer(dev, child);
1888
1889 return (retval);
1864}
1865
1866int
1867bus_generic_read_ivar(device_t dev, device_t child, int index,
1868 uintptr_t * result)
1869{
1870 return ENOENT;
1871}

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

2015int
2016bus_teardown_intr(device_t dev, struct resource *r, void *cookie)
2017{
2018 if (dev->parent == 0)
2019 return (EINVAL);
2020 return (BUS_TEARDOWN_INTR(dev->parent, dev, r, cookie));
2021}
2022
1890}
1891
1892int
1893bus_generic_read_ivar(device_t dev, device_t child, int index,
1894 uintptr_t * result)
1895{
1896 return ENOENT;
1897}

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

2041int
2042bus_teardown_intr(device_t dev, struct resource *r, void *cookie)
2043{
2044 if (dev->parent == 0)
2045 return (EINVAL);
2046 return (BUS_TEARDOWN_INTR(dev->parent, dev, r, cookie));
2047}
2048
2023static void
2049static int
2024root_print_child(device_t dev, device_t child)
2025{
2050root_print_child(device_t dev, device_t child)
2051{
2052 return (0);
2026}
2027
2028static int
2029root_setup_intr(device_t dev, device_t child, driver_intr_t *intr, void *arg,
2030 void **cookiep)
2031{
2032 /*
2033 * If an interrupt mapping gets to here something bad has happened.

--- 328 unchanged lines hidden ---
2053}
2054
2055static int
2056root_setup_intr(device_t dev, device_t child, driver_intr_t *intr, void *arg,
2057 void **cookiep)
2058{
2059 /*
2060 * If an interrupt mapping gets to here something bad has happened.

--- 328 unchanged lines hidden ---