, struct resource_list *rl, int force, } else { rid = PCIR_BAR(2); resource_list_add(rl, type, rid, 0x170, 0x177, 8); - (void)resource_list_reserve(rl, bus, dev, type, &rid, 0x170, + (void)resource_list_reserve(rl, bus, dev, type, rid, 0x170, 0x177, 8, 0); rid = PCIR_BAR(3); resource_list_add(rl, type, rid, 0x376, 0x376, 1); - (void)resource_list_reserve(rl, bus, dev, type, &rid, 0x376, + (void)resource_list_reserve(rl, bus, dev, type, rid, 0x376, 0x376, 1, 0); } pci_add_map(bus, dev, PCIR_BAR(4), rl, force, @@ -3815,7 +3815,7 @@ pci_reserve_secbus(device_t bus, device_t dev, pcicfgregs *cfg, struct resource *res; char *cp; rman_res_t start, end, count; - int rid, sec_bus, sec_reg, sub_bus, sub_reg, sup_bus; + int sec_bus, sec_reg, sub_bus, sub_reg, sup_bus; switch (cfg->hdrtype & PCIM_HDRTYPE) { case PCIM_HDRTYPE_BRIDGE: @@ -3895,8 +3895,7 @@ pci_reserve_secbus(device_t bus, device_t dev, pcicfgregs *cfg, if (pci_clear_buses) goto clear; - rid = 0; - res = resource_list_reserve(rl, bus, dev, PCI_RES_BUS, &rid, + res = resource_list_reserve(rl, bus, dev, PCI_RES_BUS, 0, start, end, count, 0); if (res != NULL) return; @@ -3945,7 +3944,7 @@ pci_alloc_secbus(device_t dev, device_t child, int rid, rman_res_t start, if (resource_list_find(rl, PCI_RES_BUS, rid) == NULL) resource_list_add(rl, PCI_RES_BUS, rid, start, end, count); if (!resource_list_reserved(rl, PCI_RES_BUS, rid)) { - res = resource_list_reserve(rl, dev, child, PCI_RES_BUS, &rid, + res = resource_list_reserve(rl, dev, child, PCI_RES_BUS, rid, start, end, count, flags & ~RF_ACTIVE); if (res == NULL) { resource_list_delete(rl, PCI_RES_BUS, rid); @@ -4106,7 +4105,7 @@ pci_add_resources_ea(device_t bus, device_t dev, int alloc_iov) continue; resource_list_add(rl, type, rid, start, end, count); - res = resource_list_reserve(rl, bus, dev, type, &rid, start, end, count, + res = resource_list_reserve(rl, bus, dev, type, rid, start, end, count, flags); if (res == NULL) { resource_list_delete(rl, type, rid); @@ -5591,7 +5590,7 @@ pci_reserve_map(device_t dev, device_t child, int type, int *rid, * appropriate BAR for that resource. */ resource_list_add(rl, type, *rid, start, end, count); - res = resource_list_reserve(rl, dev, child, type, rid, start, end, + res = resource_list_reserve(rl, dev, child, type, *rid, start, end, count, flags & ~RF_ACTIVE); if (res == NULL) { resource_list_delete(rl, type, *rid); diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 86538ac8b9d8..d2363d6c625e 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -3096,7 +3096,7 @@ resource_list_delete(struct resource_list *rl, int type, int rid) */ struct resource * resource_list_reserve(struct resource_list *rl, device_t bus, device_t child, - int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) + int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct resource_list_entry *rle = NULL; int passthrough = (device_get_parent(child) != bus); @@ -3109,10 +3109,10 @@ resource_list_reserve(struct resource_list *rl, device_t bus, device_t child, panic( "resource_list_reserve() should only reserve inactive resources"); - r = resource_list_alloc(rl, bus, child, type, *rid, start, end, count, + r = resource_list_alloc(rl, bus, child, type, rid, start, end, count, flags); if (r != NULL) { - rle = resource_list_find(rl, type, *rid); + rle = resource_list_find(rl, type, rid); rle->flags |= RLE_RESERVED; } return (r); diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 96e3da3498ea..10f596654150 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -393,7 +393,7 @@ int resource_list_release_active(struct resource_list *rl, struct resource * resource_list_reserve(struct resource_list *rl, device_t bus, device_t child, - int type, int *rid, + int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); int resource_list_unreserve(struct resource_list *rl,