isa_common.c (784d07b40d4818c743092405cd9dbdceb156dc16) isa_common.c (36fed96550cc5e0c7c87d0c69eb5beccf1d2d77f)
1/*-
2 * Copyright (c) 1999 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

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

592 struct resource_list_entry *rle;
593
594 device_probe_and_attach(child);
595
596 /*
597 * Claim any unallocated resources to keep other
598 * devices from using them.
599 */
1/*-
2 * Copyright (c) 1999 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

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

592 struct resource_list_entry *rle;
593
594 device_probe_and_attach(child);
595
596 /*
597 * Claim any unallocated resources to keep other
598 * devices from using them.
599 */
600 SLIST_FOREACH(rle, rl, link) {
600 STAILQ_FOREACH(rle, rl, link) {
601 if (!rle->res) {
602 int rid = rle->rid;
603 resource_list_alloc(rl, dev, child,
604 rle->type,
605 &rid,
606 0, ~0, 1, 0);
607 }
608 }

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

641
642static int
643isa_print_all_resources(device_t dev)
644{
645 struct isa_device *idev = DEVTOISA(dev);
646 struct resource_list *rl = &idev->id_resources;
647 int retval = 0;
648
601 if (!rle->res) {
602 int rid = rle->rid;
603 resource_list_alloc(rl, dev, child,
604 rle->type,
605 &rid,
606 0, ~0, 1, 0);
607 }
608 }

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

641
642static int
643isa_print_all_resources(device_t dev)
644{
645 struct isa_device *idev = DEVTOISA(dev);
646 struct resource_list *rl = &idev->id_resources;
647 int retval = 0;
648
649 if (SLIST_FIRST(rl) || device_get_flags(dev))
649 if (STAILQ_FIRST(rl) || device_get_flags(dev))
650 retval += printf(" at");
651
652 retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx");
653 retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx");
654 retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld");
655 retval += resource_list_print_type(rl, "drq", SYS_RES_DRQ, "%ld");
656 if (device_get_flags(dev))
657 retval += printf(" flags %#x", device_get_flags(dev));

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

873 struct resource_list *rl = &idev->id_resources;
874 struct resource_list_entry *rle;
875
876 if (TAILQ_FIRST(&idev->id_configs)) {
877 /*
878 * Claim any unallocated resources to keep other
879 * devices from using them.
880 */
650 retval += printf(" at");
651
652 retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx");
653 retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx");
654 retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld");
655 retval += resource_list_print_type(rl, "drq", SYS_RES_DRQ, "%ld");
656 if (device_get_flags(dev))
657 retval += printf(" flags %#x", device_get_flags(dev));

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

873 struct resource_list *rl = &idev->id_resources;
874 struct resource_list_entry *rle;
875
876 if (TAILQ_FIRST(&idev->id_configs)) {
877 /*
878 * Claim any unallocated resources to keep other
879 * devices from using them.
880 */
881 SLIST_FOREACH(rle, rl, link) {
881 STAILQ_FOREACH(rle, rl, link) {
882 if (!rle->res) {
883 int rid = rle->rid;
884 resource_list_alloc(rl, dev, child,
885 rle->type,
886 &rid, 0, ~0, 1, 0);
887 }
888 }
889 }

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

918 continue;
919 if (!device_is_enabled(child))
920 continue;
921
922 /*
923 * Free resources which we were holding on behalf of
924 * the device.
925 */
882 if (!rle->res) {
883 int rid = rle->rid;
884 resource_list_alloc(rl, dev, child,
885 rle->type,
886 &rid, 0, ~0, 1, 0);
887 }
888 }
889 }

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

918 continue;
919 if (!device_is_enabled(child))
920 continue;
921
922 /*
923 * Free resources which we were holding on behalf of
924 * the device.
925 */
926 SLIST_FOREACH(rle, &idev->id_resources, link) {
926 STAILQ_FOREACH(rle, &idev->id_resources, link) {
927 if (rle->res)
928 resource_list_release(rl, dev, child,
929 rle->type,
930 rle->rid,
931 rle->res);
932 }
933
934 if (TAILQ_FIRST(&idev->id_configs))
935 if (!isa_assign_resources(child))
936 continue;
937
938 device_probe_and_attach(child);
939
940 if (TAILQ_FIRST(&idev->id_configs)) {
941 /*
942 * Claim any unallocated resources to keep other
943 * devices from using them.
944 */
927 if (rle->res)
928 resource_list_release(rl, dev, child,
929 rle->type,
930 rle->rid,
931 rle->res);
932 }
933
934 if (TAILQ_FIRST(&idev->id_configs))
935 if (!isa_assign_resources(child))
936 continue;
937
938 device_probe_and_attach(child);
939
940 if (TAILQ_FIRST(&idev->id_configs)) {
941 /*
942 * Claim any unallocated resources to keep other
943 * devices from using them.
944 */
945 SLIST_FOREACH(rle, rl, link) {
945 STAILQ_FOREACH(rle, rl, link) {
946 if (!rle->res) {
947 int rid = rle->rid;
948 resource_list_alloc(rl, dev, child,
949 rle->type,
950 &rid, 0, ~0, 1, 0);
951 }
952 }
953 }

--- 177 unchanged lines hidden ---
946 if (!rle->res) {
947 int rid = rle->rid;
948 resource_list_alloc(rl, dev, child,
949 rle->type,
950 &rid, 0, ~0, 1, 0);
951 }
952 }
953 }

--- 177 unchanged lines hidden ---