bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHOD

The wrapper functions such as bus_alloc_resource_any() still support
passing the rid by value or pointer, but the underlying implementation
now passes by value.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D53402
This commit is contained in:
John Baldwin 2025-12-09 14:59:21 -05:00
parent 12165ac840
commit 575639548c
83 changed files with 276 additions and 282 deletions

View file

@ -436,7 +436,7 @@ arm_gic_print_child(device_t bus, device_t child)
}
static struct resource *
arm_gic_alloc_resource(device_t bus, device_t child, int type, int *rid,
arm_gic_alloc_resource(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)
{
struct arm_gic_softc *sc;
@ -458,11 +458,11 @@ arm_gic_alloc_resource(device_t bus, device_t child, int type, int *rid,
if (type == SYS_RES_IOPORT)
type = SYS_RES_MEMORY;
rle = resource_list_find(rl, type, *rid);
rle = resource_list_find(rl, type, rid);
if (rle == NULL) {
if (bootverbose)
device_printf(bus, "no default resources for "
"rid = %d, type = %d\n", *rid, type);
"rid = %d, type = %d\n", rid, type);
return (NULL);
}
start = rle->start;

View file

@ -343,7 +343,7 @@ static int mv_pcib_probe(device_t);
static int mv_pcib_attach(device_t);
static struct rman *mv_pcib_get_rman(device_t, int, u_int);
static struct resource *mv_pcib_alloc_resource(device_t, device_t, int, int *,
static struct resource *mv_pcib_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
static int mv_pcib_adjust_resource(device_t, device_t, struct resource *,
rman_res_t, rman_res_t);
@ -905,7 +905,7 @@ mv_pcib_get_rman(device_t dev, int type, u_int flags)
}
static struct resource *
mv_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
mv_pcib_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct mv_pcib_softc *sc = device_get_softc(dev);

View file

@ -54,7 +54,7 @@ static int mv_pcib_ctrl_attach(device_t);
static device_t mv_pcib_ctrl_add_child(device_t, u_int, const char *, int);
static const struct ofw_bus_devinfo * mv_pcib_ctrl_get_devinfo(device_t, device_t);
static struct resource * mv_pcib_ctrl_alloc_resource(device_t, device_t, int,
int *, rman_res_t, rman_res_t, rman_res_t, u_int);
int, rman_res_t, rman_res_t, rman_res_t, u_int);
void mv_pcib_ctrl_init(device_t, phandle_t);
static int mv_pcib_ofw_bus_attach(device_t);
@ -236,7 +236,7 @@ mv_pcib_ctrl_add_child(device_t dev, u_int order, const char *name, int unit)
}
static struct resource *
mv_pcib_ctrl_alloc_resource(device_t bus, device_t child, int type, int *rid,
mv_pcib_ctrl_alloc_resource(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)
{
struct mv_pcib_ctrl_devinfo *di;
@ -251,7 +251,7 @@ mv_pcib_ctrl_alloc_resource(device_t bus, device_t child, int type, int *rid,
return (NULL);
/* Find defaults for this rid */
rle = resource_list_find(&di->di_rl, type, *rid);
rle = resource_list_find(&di->di_rl, type, rid);
if (rle == NULL)
return (NULL);

View file

@ -543,7 +543,7 @@ gic_v3_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
}
static struct resource *
gic_v3_alloc_resource(device_t bus, device_t child, int type, int *rid,
gic_v3_alloc_resource(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)
{
struct gic_v3_softc *sc;
@ -563,7 +563,7 @@ gic_v3_alloc_resource(device_t bus, device_t child, int type, int *rid,
return (NULL);
/* Find defaults for this rid */
rle = resource_list_find(rl, type, *rid);
rle = resource_list_find(rl, type, rid);
if (rle == NULL)
return (NULL);

View file

@ -246,7 +246,7 @@ nexus_get_rman(device_t bus, int type, u_int flags)
* child of one of our descendants, not a direct child of nexus0.
*/
static struct resource *
nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
nexus_alloc_resource(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)
{
struct nexus_device *ndev = DEVTONX(child);
@ -261,7 +261,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
if (RMAN_IS_DEFAULT_RANGE(start, end) && (count == 1)) {
if (device_get_parent(child) != bus || ndev == NULL)
return (NULL);
rle = resource_list_find(&ndev->nx_resources, type, *rid);
rle = resource_list_find(&ndev->nx_resources, type, rid);
if (rle == NULL)
return (NULL);
start = rle->start;

View file

@ -169,7 +169,7 @@ thunder_pcie_identify_ecam(device_t dev, int *ecam)
#ifdef THUNDERX_PASS_1_1_ERRATA
struct resource *
thunder_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid,
thunder_pcie_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
pci_addr_t map, testval;
@ -183,7 +183,7 @@ thunder_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid,
if (((type == SYS_RES_IOPORT) || (type == SYS_RES_MEMORY)) &&
RMAN_IS_DEFAULT_RANGE(start, end)) {
/* Read BAR manually to get resource address and size */
pci_read_bar(child, *rid, &map, &testval, NULL);
pci_read_bar(child, rid, &map, &testval, NULL);
/* Mask the information bits */
if (PCI_BAR_MEM(map))

View file

@ -39,7 +39,7 @@ uint64_t range_addr_pci_to_phys(struct pcie_range *, uint64_t);
int thunder_pcie_identify_ecam(device_t, int *);
#ifdef THUNDERX_PASS_1_1_ERRATA
struct resource *thunder_pcie_alloc_resource(device_t,
device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int);
device_t, int, int, rman_res_t, rman_res_t, rman_res_t, u_int);
#endif
#endif /* _CAVIUM_THUNDER_PCIE_COMMON_H_ */

View file

@ -55,7 +55,7 @@
#ifdef THUNDERX_PASS_1_1_ERRATA
static struct resource * thunder_pcie_fdt_alloc_resource(device_t, device_t,
int, int *, rman_res_t, rman_res_t, rman_res_t, u_int);
int, int, rman_res_t, rman_res_t, rman_res_t, u_int);
static int thunder_pcie_fdt_release_resource(device_t, device_t,
struct resource*);
#endif
@ -228,7 +228,7 @@ thunder_pcie_fdt_get_id(device_t pci, device_t child, enum pci_id_type type,
#ifdef THUNDERX_PASS_1_1_ERRATA
struct resource *
thunder_pcie_fdt_alloc_resource(device_t dev, device_t child, int type,
int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct generic_pcie_fdt_softc *sc;
struct thunder_pcie_ofw_devinfo *di;
@ -253,7 +253,7 @@ thunder_pcie_fdt_alloc_resource(device_t dev, device_t child, int type,
type = SYS_RES_MEMORY;
/* Find defaults for this rid */
rle = resource_list_find(&di->di_rl, type, *rid);
rle = resource_list_find(&di->di_rl, type, rid);
if (rle == NULL)
return (NULL);

View file

@ -124,7 +124,7 @@ static int thunder_pem_activate_resource(device_t, device_t, struct resource *);
static int thunder_pem_adjust_resource(device_t, device_t,
struct resource *, rman_res_t, rman_res_t);
static struct resource * thunder_pem_alloc_resource(device_t, device_t, int,
int *, rman_res_t, rman_res_t, rman_res_t, u_int);
int, rman_res_t, rman_res_t, rman_res_t, u_int);
static int thunder_pem_alloc_msi(device_t, device_t, int, int, int *);
static int thunder_pem_release_msi(device_t, device_t, int, int *);
static int thunder_pem_alloc_msix(device_t, device_t, int *);
@ -651,7 +651,7 @@ thunder_pem_write_config(device_t dev, u_int bus, u_int slot,
}
static struct resource *
thunder_pem_alloc_resource(device_t dev, device_t child, int type, int *rid,
thunder_pem_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct thunder_pem_softc *sc = device_get_softc(dev);
@ -694,7 +694,7 @@ thunder_pem_alloc_resource(device_t dev, device_t child, int type, int *rid,
if (res == NULL && bootverbose) {
device_printf(dev, "%s FAIL: type=%d, rid=%d, "
"start=%016lx, end=%016lx, count=%016lx, flags=%x\n",
__func__, type, *rid, start, end, count, flags);
__func__, type, rid, start, end, count, flags);
}
return (res);

View file

@ -1562,7 +1562,7 @@ acpi_set_resource(device_t dev, device_t child, int type, int rid,
}
static struct resource *
acpi_alloc_resource(device_t bus, device_t child, int type, int *rid,
acpi_alloc_resource(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)
{
#ifndef INTRNG
@ -1590,8 +1590,8 @@ acpi_alloc_resource(device_t bus, device_t child, int type, int *rid,
* add the resource before allocating it. Note that these
* resources will not be reserved.
*/
if (!isdefault && resource_list_find(rl, type, *rid) == NULL)
resource_list_add(rl, type, *rid, start, end, count);
if (!isdefault && resource_list_find(rl, type, rid) == NULL)
resource_list_add(rl, type, rid, start, end, count);
res = resource_list_alloc(rl, bus, child, type, rid, start, end, count,
flags);
#ifndef INTRNG
@ -1604,7 +1604,7 @@ acpi_alloc_resource(device_t bus, device_t child, int type, int *rid,
*
* XXX: Should we handle the lookup failing?
*/
if (ACPI_SUCCESS(acpi_lookup_irq_resource(child, *rid, res, &ares)))
if (ACPI_SUCCESS(acpi_lookup_irq_resource(child, rid, res, &ares)))
acpi_config_intr(child, &ares);
}
#endif
@ -1616,7 +1616,7 @@ acpi_alloc_resource(device_t bus, device_t child, int type, int *rid,
* system resource regions.
*/
if (res == NULL && isdefault) {
rle = resource_list_find(rl, type, *rid);
rle = resource_list_find(rl, type, rid);
if (rle != NULL) {
start = rle->start;
end = rle->end;

View file

@ -90,7 +90,7 @@ static int acpi_pcib_map_msi(device_t pcib, device_t dev,
static int acpi_pcib_alloc_msix(device_t pcib, device_t dev,
int *irq);
static struct resource *acpi_pcib_acpi_alloc_resource(device_t dev,
device_t child, int type, int *rid,
device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
static int acpi_pcib_acpi_adjust_resource(device_t dev,
@ -423,7 +423,7 @@ acpi_pcib_acpi_attach(device_t dev)
sc->ap_bus = start;
else {
rid = 0;
bus_res = pci_domain_alloc_bus(sc->ap_segment, dev, &rid, 0,
bus_res = pci_domain_alloc_bus(sc->ap_segment, dev, rid, 0,
PCI_BUSMAX, 1, 0);
if (bus_res == NULL) {
device_printf(dev,
@ -605,7 +605,7 @@ acpi_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
}
struct resource *
acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid,
acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct acpi_hpcib_softc *sc;

View file

@ -2025,7 +2025,7 @@ agp_i915_chipset_flush_alloc_page(device_t dev, uint64_t start, uint64_t end)
vga = device_get_parent(dev);
sc->sc_flush_page_rid = 100;
sc->sc_flush_page_res = BUS_ALLOC_RESOURCE(device_get_parent(vga), dev,
SYS_RES_MEMORY, &sc->sc_flush_page_rid, start, end, PAGE_SIZE,
SYS_RES_MEMORY, sc->sc_flush_page_rid, start, end, PAGE_SIZE,
RF_ACTIVE);
if (sc->sc_flush_page_res == NULL) {
device_printf(dev, "Failed to allocate flush page at 0x%jx\n",

View file

@ -576,7 +576,7 @@ ahci_intr_one_edge(void *data)
}
struct resource *
ahci_alloc_resource(device_t dev, device_t child, int type, int *rid,
ahci_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct ahci_controller *ctlr = device_get_softc(dev);
@ -606,14 +606,14 @@ ahci_alloc_resource(device_t dev, device_t child, int type, int *rid,
size = 128;
} else if ((ctlr->caps & AHCI_CAP_EMS) == 0) {
break;
} else if (*rid == 0) {
} else if (rid == 0) {
offset = AHCI_EM_CTL;
size = 4;
} else {
offset = (ctlr->emloc & 0xffff0000) >> 14;
size = (ctlr->emloc & 0x0000ffff) << 2;
if (*rid != 1) {
if (*rid == 2 && (ctlr->capsem &
if (rid != 1) {
if (rid == 2 && (ctlr->capsem &
(AHCI_EM_XMT | AHCI_EM_SMB)) == 0)
offset += size;
else
@ -634,7 +634,7 @@ ahci_alloc_resource(device_t dev, device_t child, int type, int *rid,
}
break;
case SYS_RES_IRQ:
if (*rid == ATA_IRQ_RID)
if (rid == ATA_IRQ_RID)
res = ctlr->irqs[0].r_irq;
break;
}

View file

@ -654,7 +654,7 @@ int ahci_attach(device_t dev);
int ahci_detach(device_t dev);
int ahci_setup_interrupt(device_t dev);
int ahci_print_child(device_t dev, device_t child);
struct resource *ahci_alloc_resource(device_t dev, device_t child, int type, int *rid,
struct resource *ahci_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
int ahci_release_resource(device_t dev, device_t child, struct resource *r);
int ahci_setup_intr(device_t dev, device_t child, struct resource *irq,

View file

@ -216,7 +216,7 @@ ata_pci_write_config(device_t dev, device_t child, int reg,
}
struct resource *
ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
ata_pci_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags)
{
@ -228,7 +228,7 @@ ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
int myrid;
if (type == SYS_RES_IOPORT) {
switch (*rid) {
switch (rid) {
case ATA_IOADDR_RID:
if (controller->legacy) {
start = (unit ? ATA_SECONDARY : ATA_PRIMARY);
@ -237,7 +237,7 @@ ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
}
myrid = PCIR_BAR(0) + (unit << 3);
res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev,
SYS_RES_IOPORT, &myrid,
SYS_RES_IOPORT, myrid,
start, end, count, flags);
break;
case ATA_CTLADDR_RID:
@ -249,12 +249,12 @@ ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
}
myrid = PCIR_BAR(1) + (unit << 3);
res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev,
SYS_RES_IOPORT, &myrid,
SYS_RES_IOPORT, myrid,
start, end, count, flags);
break;
}
}
if (type == SYS_RES_IRQ && *rid == ATA_IRQ_RID) {
if (type == SYS_RES_IRQ && rid == ATA_IRQ_RID) {
if (controller->legacy) {
int irq = (unit == 0 ? 14 : 15);
@ -265,7 +265,7 @@ ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
}
} else {
if (type == SYS_RES_IRQ) {
if (*rid != ATA_IRQ_RID)
if (rid != ATA_IRQ_RID)
return (NULL);
res = controller->r_irq;
} else {

View file

@ -537,7 +537,7 @@ void ata_pci_write_config(device_t dev, device_t child, int reg,
uint32_t val, int width);
int ata_pci_print_child(device_t dev, device_t child);
int ata_pci_child_location(device_t dev, device_t child, struct sbuf *sb);
struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
int ata_pci_release_resource(device_t dev, device_t child, struct resource *r);
int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *function, void *argument, void **cookiep);
int ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie);

View file

@ -50,7 +50,7 @@ static int atkbdc_isa_attach(device_t dev);
static device_t atkbdc_isa_add_child(device_t bus, u_int order, const char *name,
int unit);
static struct resource *atkbdc_isa_alloc_resource(device_t dev, device_t child,
int type, int *rid, rman_res_t start, rman_res_t end,
int type, int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
static int atkbdc_isa_release_resource(device_t dev, device_t child,
struct resource *r);
@ -293,13 +293,13 @@ atkbdc_isa_add_child(device_t bus, u_int order, const char *name, int unit)
}
struct resource *
atkbdc_isa_alloc_resource(device_t dev, device_t child, int type, int *rid,
atkbdc_isa_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
atkbdc_softc_t *sc;
sc = *(atkbdc_softc_t **)device_get_softc(dev);
if (type == SYS_RES_IRQ && *rid == KBDC_RID_KBD && sc->irq != NULL)
if (type == SYS_RES_IRQ && rid == KBDC_RID_KBD && sc->irq != NULL)
return (sc->irq);
return (bus_generic_rl_alloc_resource(dev, child, type, rid, start,
end, count, flags));

View file

@ -2201,7 +2201,7 @@ bhnd_bus_generic_alloc_resource(device_t dev, device_t child, int type,
res = NULL;
/* Allocate the real bus resource (without activating it) */
res = BUS_ALLOC_RESOURCE(dev, child, type, rid, start, end, count,
res = BUS_ALLOC_RESOURCE(dev, child, type, *rid, start, end, count,
(flags & ~RF_ACTIVE));
if (res == NULL)
return (NULL);

View file

@ -937,7 +937,7 @@ bhndb_get_service_registry(device_t dev, device_t child)
*/
static struct resource *
bhndb_alloc_resource(device_t dev, device_t child, int type,
int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct bhndb_softc *sc;
struct resource_list_entry *rle;
@ -964,11 +964,11 @@ bhndb_alloc_resource(device_t dev, device_t child, int type,
if (!passthrough && isdefault) {
/* Fetch the resource list entry. */
rle = resource_list_find(BUS_GET_RESOURCE_LIST(dev, child),
type, *rid);
type, rid);
if (rle == NULL) {
device_printf(dev,
"default resource %#x type %d for child %s "
"not found\n", *rid, type,
"not found\n", rid, type,
device_get_nameunit(child));
return (NULL);
@ -977,7 +977,7 @@ bhndb_alloc_resource(device_t dev, device_t child, int type,
if (rle->res != NULL) {
device_printf(dev,
"resource entry %#x type %d for child %s is busy\n",
*rid, type, device_get_nameunit(child));
rid, type, device_get_nameunit(child));
return (NULL);
}
@ -997,17 +997,17 @@ bhndb_alloc_resource(device_t dev, device_t child, int type,
if (rv == NULL)
return (NULL);
rman_set_rid(rv, *rid);
rman_set_rid(rv, rid);
rman_set_type(rv, type);
/* Activate */
if (flags & RF_ACTIVE) {
error = bus_activate_resource(child, type, *rid, rv);
error = bus_activate_resource(child, type, rid, rv);
if (error) {
device_printf(dev,
"failed to activate entry %#x type %d for "
"child %s: %d\n",
*rid, type, device_get_nameunit(child), error);
rid, type, device_get_nameunit(child), error);
rman_release_resource(rv);

View file

@ -765,7 +765,7 @@ chipc_get_rman(device_t dev, int type, u_int flags)
static struct resource *
chipc_alloc_resource(device_t dev, device_t child, int type,
int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct chipc_softc *sc;
struct chipc_region *cr;
@ -793,11 +793,11 @@ chipc_alloc_resource(device_t dev, device_t child, int type,
if (!passthrough && isdefault) {
/* Fetch the resource list entry. */
rle = resource_list_find(BUS_GET_RESOURCE_LIST(dev, child),
type, *rid);
type, rid);
if (rle == NULL) {
device_printf(dev,
"default resource %#x type %d for child %s "
"not found\n", *rid, type,
"not found\n", rid, type,
device_get_nameunit(child));
return (NULL);
}
@ -806,7 +806,7 @@ chipc_alloc_resource(device_t dev, device_t child, int type,
device_printf(dev,
"resource entry %#x type %d for child %s is busy "
"[%d]\n",
*rid, type, device_get_nameunit(child),
rid, type, device_get_nameunit(child),
rman_get_flags(rle->res));
return (NULL);

View file

@ -148,7 +148,7 @@ fman_release_resource(device_t bus, device_t child, struct resource *res)
}
struct resource *
fman_alloc_resource(device_t bus, device_t child, int type, int *rid,
fman_alloc_resource(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)
{
struct fman_softc *sc;
@ -166,7 +166,7 @@ fman_alloc_resource(device_t bus, device_t child, int type, int *rid,
KASSERT(!(isdefault && passthrough),
("%s: passthrough of default allocation", __func__));
if (!passthrough) {
rle = resource_list_find(rl, type, *rid);
rle = resource_list_find(rl, type, rid);
if (rle == NULL)
return (NULL);
KASSERT(rle->res == NULL,
@ -189,10 +189,10 @@ fman_alloc_resource(device_t bus, device_t child, int type, int *rid,
end, count, flags & ~RF_ACTIVE, child);
if (res == NULL)
return (NULL);
rman_set_rid(res, *rid);
rman_set_rid(res, rid);
rman_set_type(res, type);
if ((flags & RF_ACTIVE) != 0 && bus_activate_resource(
child, type, *rid, res) != 0) {
child, type, rid, res) != 0) {
rman_release_resource(res);
return (NULL);
}

View file

@ -54,7 +54,7 @@ struct fman_softc {
* @{
*/
struct resource * fman_alloc_resource(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 rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
int fman_activate_resource(device_t bus, device_t child,
struct resource *res);
int fman_release_resource(device_t bus, device_t child, struct resource *res);

View file

@ -300,7 +300,7 @@ dpaa2_mc_detach(device_t dev)
*/
struct resource *
dpaa2_mc_alloc_resource(device_t mcdev, device_t child, int type, int *rid,
dpaa2_mc_alloc_resource(device_t mcdev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *res;
@ -333,7 +333,7 @@ dpaa2_mc_alloc_resource(device_t mcdev, device_t child, int type, int *rid,
return (res);
fail:
device_printf(mcdev, "%s() failed: type=%d, rid=%d, start=%#jx, "
"end=%#jx, count=%#jx, flags=%x\n", __func__, type, *rid, start, end,
"end=%#jx, count=%#jx, flags=%x\n", __func__, type, rid, start, end,
count, flags);
return (NULL);
}

View file

@ -181,7 +181,7 @@ int dpaa2_mc_detach(device_t dev);
struct rman *dpaa2_mc_rman(device_t mcdev, int type, u_int flags);
struct resource * dpaa2_mc_alloc_resource(device_t mcdev, device_t child,
int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count,
int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
int dpaa2_mc_adjust_resource(device_t mcdev, device_t child,
struct resource *r, rman_res_t start, rman_res_t end);

View file

@ -225,7 +225,7 @@ dpaa2_rc_delete_resource(device_t rcdev, device_t child, int type, int rid)
}
static struct resource *
dpaa2_rc_alloc_multi_resource(device_t rcdev, device_t child, int type, int *rid,
dpaa2_rc_alloc_multi_resource(device_t rcdev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource_list *rl;
@ -243,7 +243,7 @@ dpaa2_rc_alloc_multi_resource(device_t rcdev, device_t child, int type, int *rid
* dedicated software portal interrupt wire.
* See registers SWP_INTW0_CFG to SWP_INTW3_CFG for details.
*/
if (type == SYS_RES_IRQ && *rid == 0)
if (type == SYS_RES_IRQ && rid == 0)
return (NULL);
return (resource_list_alloc(rl, rcdev, child, type, rid,
@ -251,7 +251,7 @@ dpaa2_rc_alloc_multi_resource(device_t rcdev, device_t child, int type, int *rid
}
static struct resource *
dpaa2_rc_alloc_resource(device_t rcdev, device_t child, int type, int *rid,
dpaa2_rc_alloc_resource(device_t rcdev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
if (device_get_parent(child) != rcdev)

View file

@ -858,7 +858,7 @@ exca_deactivate_resource(struct exca_softc *exca, device_t child,
#if 0
static struct resource *
exca_alloc_resource(struct exca_softc *sc, device_t child, int type, int *rid,
exca_alloc_resource(struct exca_softc *sc, device_t child, int type, int rid,
u_long start, u_long end, u_long count, uint flags)
{
struct resource *res = NULL;
@ -895,10 +895,10 @@ exca_alloc_resource(struct exca_softc *sc, device_t child, int type, int *rid,
start, end, count, flags & ~RF_ACTIVE);
if (res == NULL)
return (NULL);
cbb_insert_res(sc, res, type, *rid);
cbb_insert_res(sc, res, type, rid);
if (flags & RF_ACTIVE) {
if (bus_activate_resource(child, type, *rid, res) != 0) {
bus_release_resource(child, type, *rid, res);
if (bus_activate_resource(child, type, rid, res) != 0) {
bus_release_resource(child, type, rid, res);
return (NULL);
}
}

View file

@ -48,7 +48,7 @@
*/
static int simplebus_probe(device_t dev);
static struct resource *simplebus_alloc_resource(device_t, device_t, int,
int *, rman_res_t, rman_res_t, rman_res_t, u_int);
int, rman_res_t, rman_res_t, rman_res_t, u_int);
static void simplebus_probe_nomatch(device_t bus, device_t child);
static int simplebus_print_child(device_t bus, device_t child);
static device_t simplebus_add_child(device_t dev, u_int order,
@ -460,7 +460,7 @@ simplebus_get_property(device_t bus, device_t child, const char *propname,
}
static struct resource *
simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid,
simplebus_alloc_resource(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)
{
struct simplebus_softc *sc;
@ -478,11 +478,11 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid,
if ((di = device_get_ivars(child)) == NULL)
return (NULL);
rle = resource_list_find(&di->rl, type, *rid);
rle = resource_list_find(&di->rl, type, rid);
if (rle == NULL) {
if (bootverbose)
device_printf(bus, "no default resources for "
"rid = %d, type = %d\n", *rid, type);
"rid = %d, type = %d\n", rid, type);
return (NULL);
}
start = rle->start;

View file

@ -864,7 +864,7 @@ gpiobus_get_rman(device_t bus, int type, u_int flags)
}
static struct resource *
gpiobus_alloc_resource(device_t bus, device_t child, int type, int *rid,
gpiobus_alloc_resource(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)
{
struct resource_list *rl;
@ -876,7 +876,7 @@ gpiobus_alloc_resource(device_t bus, device_t child, int type, int *rid,
rl = BUS_GET_RESOURCE_LIST(bus, child);
if (rl == NULL)
return (NULL);
rle = resource_list_find(rl, type, *rid);
rle = resource_list_find(rl, type, rid);
if (rle == NULL)
return (NULL);
start = rle->start;

View file

@ -1663,7 +1663,7 @@ vmbus_pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t val)
}
static struct resource *
vmbus_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
vmbus_pcib_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
unsigned int bar_no;
@ -1687,7 +1687,7 @@ vmbus_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
if (!hpdev)
return (NULL);
bar_no = PCI_RID2BAR(*rid);
bar_no = PCI_RID2BAR(rid);
if (bar_no >= MAX_NUM_BARS)
return (NULL);

View file

@ -92,7 +92,7 @@ static int vmbus_read_ivar(device_t, device_t, int,
uintptr_t *);
static int vmbus_child_pnpinfo(device_t, device_t, struct sbuf *);
static struct resource *vmbus_alloc_resource(device_t dev,
device_t child, int type, int *rid,
device_t child, int type, int rid,
rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
static int vmbus_alloc_msi(device_t bus, device_t dev,
@ -1062,7 +1062,7 @@ vmbus_sysctl_version(SYSCTL_HANDLER_ARGS)
* For the release function, we can use bus_generic_release_resource().
*/
static struct resource *
vmbus_alloc_resource(device_t dev, device_t child, int type, int *rid,
vmbus_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
device_t parent = device_get_parent(dev);
@ -1346,7 +1346,7 @@ vmbus_fb_mmio_res(device_t dev)
fb_start, fb_count, fb_height * fb_width);
hv_fb_res = pcib_host_res_alloc(&sc->vmbus_mmio_res, dev,
SYS_RES_MEMORY, &rid, fb_start, fb_end, fb_count,
SYS_RES_MEMORY, rid, fb_start, fb_end, fb_count,
RF_ACTIVE | rman_make_alignment_flags(PAGE_SIZE));
if (hv_fb_res && bootverbose)

View file

@ -389,7 +389,7 @@ mvs_intr(void *data)
}
static struct resource *
mvs_alloc_resource(device_t dev, device_t child, int type, int *rid,
mvs_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags)
{
@ -415,7 +415,7 @@ mvs_alloc_resource(device_t dev, device_t child, int type, int *rid,
}
break;
case SYS_RES_IRQ:
if (*rid == ATA_IRQ_RID)
if (rid == ATA_IRQ_RID)
res = ctlr->irq.r_irq;
break;
}

View file

@ -329,7 +329,7 @@ mvs_intr(void *data)
}
static struct resource *
mvs_alloc_resource(device_t dev, device_t child, int type, int *rid,
mvs_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct mvs_controller *ctlr = device_get_softc(dev);
@ -354,7 +354,7 @@ mvs_alloc_resource(device_t dev, device_t child, int type, int *rid,
}
break;
case SYS_RES_IRQ:
if (*rid == ATA_IRQ_RID)
if (rid == ATA_IRQ_RID)
res = ctlr->irq.r_irq;
break;
}

View file

@ -66,7 +66,7 @@
*/
static struct rman *ofw_pcib_get_rman(device_t, int, u_int);
static struct resource * ofw_pcib_alloc_resource(device_t, device_t,
int, int *, rman_res_t, rman_res_t, rman_res_t, u_int);
int, int, rman_res_t, rman_res_t, rman_res_t, u_int);
static int ofw_pcib_release_resource(device_t, device_t, struct resource *);
static int ofw_pcib_activate_resource(device_t, device_t, struct resource *);
static int ofw_pcib_deactivate_resource(device_t, device_t, struct resource *);
@ -419,7 +419,7 @@ ofw_pcib_nranges(phandle_t node, struct ofw_pci_cell_info *info)
}
static struct resource *
ofw_pcib_alloc_resource(device_t bus, device_t child, int type, int *rid,
ofw_pcib_alloc_resource(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)
{
struct ofw_pci_softc *sc;

View file

@ -130,7 +130,7 @@ ofwbus_attach(device_t dev)
}
static struct resource *
ofwbus_alloc_resource(device_t bus, device_t child, int type, int *rid,
ofwbus_alloc_resource(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)
{
struct resource *rv;
@ -142,11 +142,11 @@ ofwbus_alloc_resource(device_t bus, device_t child, int type, int *rid,
rle = NULL;
if (!passthrough && isdefault) {
rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child),
type, *rid);
type, rid);
if (rle == NULL) {
if (bootverbose)
device_printf(bus, "no default resources for "
"rid = %d, type = %d\n", *rid, type);
"rid = %d, type = %d\n", rid, type);
return (NULL);
}
start = rle->start;

View file

@ -159,7 +159,7 @@ static int cbb_cardbus_activate_resource(device_t brdev, device_t child,
static int cbb_cardbus_deactivate_resource(device_t brdev,
device_t child, struct resource *res);
static struct resource *cbb_cardbus_alloc_resource(device_t brdev,
device_t child, int type, int *rid, rman_res_t start,
device_t child, int type, int rid, rman_res_t start,
rman_res_t end, rman_res_t count, u_int flags);
static int cbb_cardbus_release_resource(device_t brdev, device_t child,
struct resource *res);
@ -1174,7 +1174,7 @@ cbb_cardbus_deactivate_resource(device_t brdev, device_t child,
static struct resource *
cbb_cardbus_alloc_resource(device_t brdev, device_t child, int type,
int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct cbb_softc *sc = device_get_softc(brdev);
int tmp;
@ -1219,13 +1219,13 @@ cbb_cardbus_alloc_resource(device_t brdev, device_t child, int type,
res = BUS_ALLOC_RESOURCE(device_get_parent(brdev), child, type, rid,
start, end, count, flags & ~RF_ACTIVE);
if (res == NULL) {
printf("cbb alloc res fail type %d rid %x\n", type, *rid);
printf("cbb alloc res fail type %d rid %x\n", type, rid);
return (NULL);
}
cbb_insert_res(sc, res, type, *rid);
cbb_insert_res(sc, res, type, rid);
if (flags & RF_ACTIVE)
if (bus_activate_resource(child, type, *rid, res) != 0) {
bus_release_resource(child, type, *rid, res);
if (bus_activate_resource(child, type, rid, res) != 0) {
bus_release_resource(child, type, rid, res);
return (NULL);
}
@ -1338,7 +1338,7 @@ cbb_pcic_deactivate_resource(device_t brdev, device_t child,
}
static struct resource *
cbb_pcic_alloc_resource(device_t brdev, device_t child, int type, int *rid,
cbb_pcic_alloc_resource(device_t brdev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *res = NULL;
@ -1382,10 +1382,10 @@ cbb_pcic_alloc_resource(device_t brdev, device_t child, int type, int *rid,
start, end, count, flags & ~RF_ACTIVE);
if (res == NULL)
return (NULL);
cbb_insert_res(sc, res, type, *rid);
cbb_insert_res(sc, res, type, rid);
if (flags & RF_ACTIVE) {
if (bus_activate_resource(child, type, *rid, res) != 0) {
bus_release_resource(child, type, *rid, res);
if (bus_activate_resource(child, type, rid, res) != 0) {
bus_release_resource(child, type, rid, res);
return (NULL);
}
}
@ -1475,7 +1475,7 @@ cbb_deactivate_resource(device_t brdev, device_t child, struct resource *r)
}
struct resource *
cbb_alloc_resource(device_t brdev, device_t child, int type, int *rid,
cbb_alloc_resource(device_t brdev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct cbb_softc *sc = device_get_softc(brdev);

View file

@ -749,7 +749,7 @@ cbb_pci_filt(void *arg)
}
static struct resource *
cbb_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
cbb_pci_alloc_resource(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)
{
struct cbb_softc *sc;

View file

@ -110,7 +110,7 @@ extern int cbb_debug;
int cbb_activate_resource(device_t brdev, device_t child,
struct resource *r);
struct resource *cbb_alloc_resource(device_t brdev, device_t child,
int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count,
int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
void cbb_child_detached(device_t brdev, device_t child);
int cbb_child_present(device_t parent, device_t child);

View file

@ -98,7 +98,7 @@ pci_hostb_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
}
static struct resource *
pci_hostb_alloc_resource(device_t dev, device_t child, int type, int *rid,
pci_hostb_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{

View file

@ -52,7 +52,7 @@
static int isab_pci_probe(device_t dev);
static int isab_pci_attach(device_t dev);
static struct resource * isab_pci_alloc_resource(device_t dev,
device_t child, int type, int *rid, rman_res_t start, rman_res_t end,
device_t child, int type, int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
static int isab_pci_release_resource(device_t dev, device_t child,
struct resource *r);
@ -165,7 +165,7 @@ isab_pci_attach(device_t dev)
}
static struct resource *
isab_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
isab_pci_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct isab_pci_softc *sc;
@ -182,7 +182,7 @@ isab_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
* For BARs, we cache the resource so that we only allocate it
* from the PCI bus once.
*/
bar = PCI_RID2BAR(*rid);
bar = PCI_RID2BAR(rid);
if (bar < 0 || bar > PCIR_MAX_BAR_0)
return (NULL);
sc = device_get_softc(dev);

View file

@ -3914,7 +3914,7 @@ clear:
}
static struct resource *
pci_alloc_secbus(device_t dev, device_t child, int *rid, rman_res_t start,
pci_alloc_secbus(device_t dev, device_t child, int rid, rman_res_t start,
rman_res_t end, rman_res_t count, u_int flags)
{
struct pci_devinfo *dinfo;
@ -3939,16 +3939,16 @@ pci_alloc_secbus(device_t dev, device_t child, int *rid, rman_res_t start,
return (NULL);
}
if (*rid != 0)
if (rid != 0)
return (NULL);
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,
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,
start, end, count, flags & ~RF_ACTIVE);
if (res == NULL) {
resource_list_delete(rl, PCI_RES_BUS, *rid);
resource_list_delete(rl, PCI_RES_BUS, rid);
device_printf(child, "allocating %ju bus%s failed\n",
count, count == 1 ? "" : "es");
return (NULL);
@ -5620,7 +5620,7 @@ out:
}
struct resource *
pci_alloc_multi_resource(device_t dev, device_t child, int type, int *rid,
pci_alloc_multi_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_long num,
u_int flags)
{
@ -5645,7 +5645,7 @@ pci_alloc_multi_resource(device_t dev, device_t child, int type, int *rid,
* Can't alloc legacy interrupt once MSI messages have
* been allocated.
*/
if (*rid == 0 && (cfg->msi.msi_alloc > 0 ||
if (rid == 0 && (cfg->msi.msi_alloc > 0 ||
cfg->msix.msix_alloc > 0))
return (NULL);
@ -5654,7 +5654,7 @@ pci_alloc_multi_resource(device_t dev, device_t child, int type, int *rid,
* routed and is deserving of an interrupt, try to
* assign it one.
*/
if (*rid == 0 && !PCI_INTERRUPT_VALID(cfg->intline) &&
if (rid == 0 && !PCI_INTERRUPT_VALID(cfg->intline) &&
(cfg->intpin != 0))
pci_assign_interrupt(dev, child, 0);
break;
@ -5666,7 +5666,7 @@ pci_alloc_multi_resource(device_t dev, device_t child, int type, int *rid,
* tree.
*/
if (cfg->hdrtype == PCIM_HDRTYPE_BRIDGE) {
switch (*rid) {
switch (rid) {
case PCIR_IOBASEL_1:
case PCIR_MEMBASE_1:
case PCIR_PMBASEL_1:
@ -5679,9 +5679,9 @@ pci_alloc_multi_resource(device_t dev, device_t child, int type, int *rid,
}
}
/* Reserve resources for this BAR if needed. */
rle = resource_list_find(rl, type, *rid);
rle = resource_list_find(rl, type, rid);
if (rle == NULL) {
res = pci_reserve_map(dev, child, type, rid, start, end,
res = pci_reserve_map(dev, child, type, &rid, start, end,
count, num, flags);
if (res == NULL)
return (NULL);
@ -5692,7 +5692,7 @@ pci_alloc_multi_resource(device_t dev, device_t child, int type, int *rid,
}
struct resource *
pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
pci_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
#ifdef PCI_IOV

View file

@ -503,7 +503,7 @@ generic_pcie_translate_resource(device_t dev, int type, rman_res_t start,
struct resource *
pci_host_generic_core_alloc_resource(device_t dev, device_t child, int type,
int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct generic_pcie_core_softc *sc;
struct resource *res;
@ -528,7 +528,7 @@ pci_host_generic_core_alloc_resource(device_t dev, device_t child, int type,
if (res == NULL) {
device_printf(dev, "%s FAIL: type=%d, rid=%d, "
"start=%016jx, end=%016jx, count=%016jx, flags=%x\n",
__func__, type, *rid, start, end, count, flags);
__func__, type, rid, start, end, count, flags);
}
return (res);
}

View file

@ -95,7 +95,7 @@ DECLARE_CLASS(generic_pcie_core_driver);
int pci_host_generic_core_attach(device_t);
int pci_host_generic_core_detach(device_t);
struct resource *pci_host_generic_core_alloc_resource(device_t, device_t, int,
int *, rman_res_t, rman_res_t, rman_res_t, u_int);
int, rman_res_t, rman_res_t, rman_res_t, u_int);
int pci_host_generic_core_release_resource(device_t, device_t,
struct resource *);
int generic_pcie_read_ivar(device_t, device_t, int, uintptr_t *);

View file

@ -350,7 +350,7 @@ pci_iov_alloc_bar(struct pci_devinfo *dinfo, int bar, pci_addr_t bar_shift)
rid = iov->iov_pos + PCIR_SRIOV_BAR(bar);
bar_size = 1 << bar_shift;
res = pci_alloc_multi_resource(bus, dev, SYS_RES_MEMORY, &rid, 0,
res = pci_alloc_multi_resource(bus, dev, SYS_RES_MEMORY, rid, 0,
~0, 1, iov->iov_num_vfs, RF_ACTIVE);
if (res == NULL)
@ -1016,7 +1016,7 @@ pci_iov_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
}
struct resource *
pci_vf_alloc_mem_resource(device_t dev, device_t child, int *rid,
pci_vf_alloc_mem_resource(device_t dev, device_t child, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct pci_devinfo *dinfo;
@ -1031,7 +1031,7 @@ pci_vf_alloc_mem_resource(device_t dev, device_t child, int *rid,
dinfo = device_get_ivars(child);
iov = dinfo->cfg.iov;
map = pci_find_bar(child, *rid);
map = pci_find_bar(child, rid);
if (map == NULL)
return (NULL);
@ -1055,21 +1055,21 @@ pci_vf_alloc_mem_resource(device_t dev, device_t child, int *rid,
if (res == NULL)
return (NULL);
rle = resource_list_add(&dinfo->resources, SYS_RES_MEMORY, *rid,
rle = resource_list_add(&dinfo->resources, SYS_RES_MEMORY, rid,
bar_start, bar_end, 1);
if (rle == NULL) {
rman_release_resource(res);
return (NULL);
}
rman_set_rid(res, *rid);
rman_set_rid(res, rid);
rman_set_type(res, SYS_RES_MEMORY);
if (flags & RF_ACTIVE) {
error = bus_activate_resource(child, SYS_RES_MEMORY, *rid, res);
error = bus_activate_resource(child, SYS_RES_MEMORY, rid, res);
if (error != 0) {
resource_list_delete(&dinfo->resources, SYS_RES_MEMORY,
*rid);
rid);
rman_release_resource(res);
return (NULL);
}

View file

@ -695,7 +695,7 @@ pcib_free_secbus(device_t dev, struct pcib_secbus *bus)
}
static struct resource *
pcib_suballoc_bus(struct pcib_secbus *bus, device_t child, int *rid,
pcib_suballoc_bus(struct pcib_secbus *bus, device_t child, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *res;
@ -708,9 +708,9 @@ pcib_suballoc_bus(struct pcib_secbus *bus, device_t child, int *rid,
if (bootverbose)
device_printf(bus->dev,
"allocated bus range (%ju-%ju) for rid %d of %s\n",
rman_get_start(res), rman_get_end(res), *rid,
rman_get_start(res), rman_get_end(res), rid,
pcib_child_name(child));
rman_set_rid(res, *rid);
rman_set_rid(res, rid);
rman_set_type(res, PCI_RES_BUS);
return (res);
}
@ -745,7 +745,7 @@ pcib_grow_subbus(struct pcib_secbus *bus, rman_res_t new_end)
}
struct resource *
pcib_alloc_subbus(struct pcib_secbus *bus, device_t child, int *rid,
pcib_alloc_subbus(struct pcib_secbus *bus, device_t child, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *res;
@ -1661,7 +1661,7 @@ pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
*/
static struct resource *
pcib_suballoc_resource(struct pcib_softc *sc, struct pcib_window *w,
device_t child, int type, int *rid, rman_res_t start, rman_res_t end,
device_t child, int type, int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags)
{
struct resource *res;
@ -1677,13 +1677,13 @@ pcib_suballoc_resource(struct pcib_softc *sc, struct pcib_window *w,
if (bootverbose)
device_printf(sc->dev,
"allocated %s range (%#jx-%#jx) for rid %x of %s\n",
w->name, rman_get_start(res), rman_get_end(res), *rid,
w->name, rman_get_start(res), rman_get_end(res), rid,
pcib_child_name(child));
rman_set_rid(res, *rid);
rman_set_rid(res, rid);
rman_set_type(res, type);
if (flags & RF_ACTIVE) {
if (bus_activate_resource(child, type, *rid, res) != 0) {
if (bus_activate_resource(child, type, rid, res) != 0) {
rman_release_resource(res);
return (NULL);
}
@ -2032,7 +2032,7 @@ updatewin:
* is set up to, or capable of handling them.
*/
static struct resource *
pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
pcib_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct pcib_softc *sc;

View file

@ -151,11 +151,11 @@ struct resource *pci_reserve_map(device_t dev, device_t child, int type,
rman_res_t count, u_int num, u_int flags);
struct resource *pci_alloc_multi_resource(device_t dev, device_t child,
int type, int *rid, rman_res_t start, rman_res_t end,
int type, int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_long num, u_int flags);
struct resource *pci_vf_alloc_mem_resource(device_t dev, device_t child,
int *rid, rman_res_t start, rman_res_t end,
int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
int pci_vf_release_mem_resource(device_t dev, device_t child,
struct resource *r);

View file

@ -200,7 +200,7 @@ pcib_host_res_decodes(struct pcib_host_resources *hr, int type, rman_res_t start
struct resource *
pcib_host_res_alloc(struct pcib_host_resources *hr, device_t dev, int type,
int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource_list_entry *rle;
struct resource *r;
@ -241,7 +241,7 @@ restart:
device_printf(hr->hr_pcib,
"allocated type %d (%#jx-%#jx) for rid %x of %s\n",
type, rman_get_start(r), rman_get_end(r),
*rid, pcib_child_name(dev));
rid, pcib_child_name(dev));
return (r);
}
}
@ -327,7 +327,7 @@ pci_find_domain(int domain)
}
struct resource *
pci_domain_alloc_bus(int domain, device_t dev, int *rid, rman_res_t start,
pci_domain_alloc_bus(int domain, device_t dev, int rid, rman_res_t start,
rman_res_t end, rman_res_t count, u_int flags)
{
struct pci_domain *d;
@ -341,7 +341,7 @@ pci_domain_alloc_bus(int domain, device_t dev, int *rid, rman_res_t start,
if (res == NULL)
return (NULL);
rman_set_rid(res, *rid);
rman_set_rid(res, rid);
rman_set_type(res, PCI_RES_BUS);
return (res);
}

View file

@ -52,7 +52,7 @@ int pcib_host_res_free(device_t pcib,
int pcib_host_res_decodes(struct pcib_host_resources *hr, int type,
rman_res_t start, rman_res_t end, u_int flags);
struct resource *pcib_host_res_alloc(struct pcib_host_resources *hr,
device_t dev, int type, int *rid, rman_res_t start,
device_t dev, int type, int rid, rman_res_t start,
rman_res_t end, rman_res_t count, u_int flags);
int pcib_host_res_adjust(struct pcib_host_resources *hr,
device_t dev, struct resource *r, rman_res_t start,
@ -138,7 +138,7 @@ typedef uint32_t pci_read_config_fn(int d, int b, int s, int f, int reg,
int host_pcib_get_busno(pci_read_config_fn read_config, int bus,
int slot, int func, uint8_t *busnum);
struct resource *pci_domain_alloc_bus(int domain, device_t dev, int *rid,
struct resource *pci_domain_alloc_bus(int domain, device_t dev, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
int pci_domain_adjust_bus(int domain, device_t dev,
struct resource *r, rman_res_t start, rman_res_t end);
@ -149,7 +149,7 @@ int pci_domain_activate_bus(int domain, device_t dev,
int pci_domain_deactivate_bus(int domain, device_t dev,
struct resource *r);
struct resource *pcib_alloc_subbus(struct pcib_secbus *bus, device_t child,
int *rid, rman_res_t start, rman_res_t end, rman_res_t count,
int rid, rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
void pcib_free_secbus(device_t dev, struct pcib_secbus *bus);
void pcib_setup_secbus(device_t dev, struct pcib_secbus *bus,

View file

@ -67,7 +67,7 @@ SYSCTL_DECL(_hw_pci);
static struct vga_resource *lookup_res(struct vga_pci_softc *sc, int rid);
static struct resource *vga_pci_alloc_resource(device_t dev, device_t child,
int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count,
int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
static int vga_pci_release_resource(device_t dev, device_t child,
struct resource *r);
@ -212,7 +212,7 @@ vga_pci_map_bios(device_t dev, size_t *size)
}
if (rid == 0)
return (NULL);
res = vga_pci_alloc_resource(dev, NULL, SYS_RES_MEMORY, &rid, 0,
res = vga_pci_alloc_resource(dev, NULL, SYS_RES_MEMORY, rid, 0,
~0, 1, RF_ACTIVE);
if (res == NULL) {
@ -246,7 +246,7 @@ vga_pci_map_bios(device_t dev, size_t *size)
/*
* re-allocate
*/
res = vga_pci_alloc_resource(dev, NULL, SYS_RES_MEMORY, &rid, 0,
res = vga_pci_alloc_resource(dev, NULL, SYS_RES_MEMORY, rid, 0,
~0, 1, RF_ACTIVE);
if (res == NULL) {
device_printf(dev, "vga_pci_alloc_resource failed\n");
@ -424,7 +424,7 @@ lookup_res(struct vga_pci_softc *sc, int rid)
}
static struct resource *
vga_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
vga_pci_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct vga_resource *vr;
@ -436,7 +436,7 @@ vga_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
* For BARs, we cache the resource so that we only allocate it
* from the PCI bus once.
*/
vr = lookup_res(device_get_softc(dev), *rid);
vr = lookup_res(device_get_softc(dev), rid);
if (vr == NULL)
return (NULL);
if (vr->vr_res == NULL)

View file

@ -1964,14 +1964,14 @@ ppc_write_ivar(device_t bus, device_t dev, int index, uintptr_t val)
* interrupt handlers.
*/
struct resource *
ppc_alloc_resource(device_t bus, device_t child, int type, int *rid,
ppc_alloc_resource(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)
{
struct ppc_data *ppc = DEVTOSOFTC(bus);
switch (type) {
case SYS_RES_IRQ:
if (*rid == 0)
if (rid == 0)
return (ppc->res_irq);
break;
}

View file

@ -41,7 +41,7 @@ u_char ppc_io(device_t, int, u_char *, int, u_char);
int ppc_exec_microseq(device_t, struct ppb_microseq **);
struct resource *ppc_alloc_resource(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 rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
int ppc_release_resource(device_t bus, device_t child, struct resource *r);
int ppc_reset_epp(device_t);
int ppc_ecp_sync(device_t);

View file

@ -469,7 +469,7 @@ puc_bfe_probe(device_t dev, const struct puc_cfg *cfg)
}
struct resource *
puc_bus_alloc_resource(device_t dev, device_t child, int type, int *rid,
puc_bus_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct puc_port *port;
@ -487,7 +487,7 @@ puc_bus_alloc_resource(device_t dev, device_t child, int type, int *rid,
port = device_get_ivars(child);
KASSERT(port != NULL, ("%s %d", __func__, __LINE__));
if (rid == NULL || *rid != 0)
if (rid != 0)
return (NULL);
/* We only support default allocations. */

View file

@ -84,7 +84,7 @@ int puc_bfe_probe(device_t, const struct puc_cfg *);
int puc_bus_child_location(device_t, device_t, struct sbuf *sb);
int puc_bus_child_pnpinfo(device_t, device_t, struct sbuf *sb);
struct resource *puc_bus_alloc_resource(device_t, device_t, int, int *,
struct resource *puc_bus_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
int puc_bus_get_resource(device_t, device_t, int, int, rman_res_t *, rman_res_t *);
int puc_bus_print_child(device_t, device_t);

View file

@ -59,7 +59,7 @@ int quicc_bfe_attach(device_t);
int quicc_bfe_detach(device_t);
int quicc_bfe_probe(device_t, u_int);
struct resource *quicc_bus_alloc_resource(device_t, device_t, int, int *,
struct resource *quicc_bus_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
int quicc_bus_get_resource(device_t, device_t, int, int,
rman_res_t *, rman_res_t *);

View file

@ -251,7 +251,7 @@ quicc_bfe_probe(device_t dev, u_int clock)
}
struct resource *
quicc_bus_alloc_resource(device_t dev, device_t child, int type, int *rid,
quicc_bus_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct quicc_device *qd;
@ -265,7 +265,7 @@ quicc_bus_alloc_resource(device_t dev, device_t child, int type, int *rid,
return (NULL);
qd = device_get_ivars(child);
rle = resource_list_find(&qd->qd_rlist, type, *rid);
rle = resource_list_find(&qd->qd_rlist, type, rid);
if (rle == NULL)
return (NULL);

View file

@ -141,7 +141,7 @@ int scc_bfe_attach(device_t dev, u_int ipc);
int scc_bfe_detach(device_t dev);
int scc_bfe_probe(device_t dev, u_int regshft, u_int rclk, u_int rid);
struct resource *scc_bus_alloc_resource(device_t, device_t, int, int *,
struct resource *scc_bus_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
int scc_bus_get_resource(device_t, device_t, int, int, rman_res_t *, rman_res_t *);
int scc_bus_read_ivar(device_t, device_t, int, uintptr_t *);

View file

@ -406,7 +406,7 @@ scc_bfe_probe(device_t dev, u_int regshft, u_int rclk, u_int rid)
}
struct resource *
scc_bus_alloc_resource(device_t dev, device_t child, int type, int *rid,
scc_bus_alloc_resource(device_t dev, device_t child, int type, int rid __unused,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource_list_entry *rle;
@ -425,7 +425,6 @@ scc_bus_alloc_resource(device_t dev, device_t child, int type, int *rid,
rle = resource_list_find(&ch->ch_rlist, type, 0);
if (rle == NULL)
return (NULL);
*rid = 0;
return (rle->res);
}

View file

@ -314,7 +314,7 @@ siis_intr(void *data)
}
static struct resource *
siis_alloc_resource(device_t dev, device_t child, int type, int *rid,
siis_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct siis_controller *ctlr = device_get_softc(dev);
@ -339,7 +339,7 @@ siis_alloc_resource(device_t dev, device_t child, int type, int *rid,
}
break;
case SYS_RES_IRQ:
if (*rid == ATA_IRQ_RID)
if (rid == ATA_IRQ_RID)
res = ctlr->irq.r_irq;
break;
}

View file

@ -79,7 +79,7 @@ typedef struct csa_softc *sc_p;
static int csa_probe(device_t dev);
static int csa_attach(device_t dev);
static struct resource *csa_alloc_resource(device_t bus, device_t child, int type, int *rid,
static struct resource *csa_alloc_resource(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);
static int csa_release_resource(device_t bus, device_t child, struct resource *r);
@ -353,7 +353,7 @@ csa_resume(device_t dev)
}
static struct resource *
csa_alloc_resource(device_t bus, device_t child, int type, int *rid,
csa_alloc_resource(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)
{
sc_p scp;
@ -364,12 +364,12 @@ csa_alloc_resource(device_t bus, device_t child, int type, int *rid,
resp = &scp->res;
switch (type) {
case SYS_RES_IRQ:
if (*rid != 0)
if (rid != 0)
return (NULL);
res = resp->irq;
break;
case SYS_RES_MEMORY:
switch (*rid) {
switch (rid) {
case PCIR_BAR(0):
res = resp->io;
break;

View file

@ -708,7 +708,7 @@ fm801_pci_probe( device_t dev )
}
static struct resource *
fm801_alloc_resource(device_t bus, device_t child, int type, int *rid,
fm801_alloc_resource(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)
{
@ -716,7 +716,7 @@ fm801_alloc_resource(device_t bus, device_t child, int type, int *rid,
fm801 = pcm_getdevinfo(bus);
if (type == SYS_RES_IOPORT && *rid == PCIR_BAR(0))
if (type == SYS_RES_IOPORT && rid == PCIR_BAR(0))
return (fm801->reg);
return (NULL);

View file

@ -416,7 +416,7 @@ acpi_spibus_resume(device_t dev)
#ifndef INTRNG
/* Mostly copy of acpi_alloc_resource() */
static struct resource *
acpi_spibus_alloc_resource(device_t dev, device_t child, int type, int *rid,
acpi_spibus_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
ACPI_RESOURCE ares;
@ -434,7 +434,7 @@ acpi_spibus_alloc_resource(device_t dev, device_t child, int type, int *rid,
res = resource_list_alloc(rl, dev, child, type, rid,
start, end, count, flags);
if (res != NULL && type == SYS_RES_IRQ &&
ACPI_SUCCESS(acpi_lookup_irq_resource(child, *rid, res, &ares)))
ACPI_SUCCESS(acpi_lookup_irq_resource(child, rid, res, &ares)))
acpi_config_intr(child, &ares);
return (res);

View file

@ -432,14 +432,14 @@ vmd_get_rman(device_t dev, int type, u_int flags)
}
static struct resource *
vmd_alloc_resource(device_t dev, device_t child, int type, int *rid,
vmd_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *res;
if (type == SYS_RES_IRQ) {
/* VMD hardware does not support legacy interrupts. */
if (*rid == 0)
if (rid == 0)
return (NULL);
return (bus_generic_alloc_resource(dev, child, type, rid,
start, end, count, flags | RF_SHAREABLE));
@ -451,13 +451,13 @@ vmd_alloc_resource(device_t dev, device_t child, int type, int *rid,
case SYS_RES_MEMORY:
device_printf(dev,
"allocated memory range (%#jx-%#jx) for rid %d of %s\n",
rman_get_start(res), rman_get_end(res), *rid,
rman_get_start(res), rman_get_end(res), rid,
pcib_child_name(child));
break;
case PCI_RES_BUS:
device_printf(dev,
"allocated bus range (%ju-%ju) for rid %d of %s\n",
rman_get_start(res), rman_get_end(res), *rid,
rman_get_start(res), rman_get_end(res), rid,
pcib_child_name(child));
break;
}

View file

@ -49,7 +49,7 @@ static MALLOC_DEFINE(M_MRMLB, "MRML bridge", "Cavium MRML bridge");
static device_probe_t mrmlb_fdt_probe;
static device_attach_t mrmlb_fdt_attach;
static struct resource * mrmlb_ofw_bus_alloc_res(device_t, device_t, int, int *,
static struct resource * mrmlb_ofw_bus_alloc_res(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
static const struct ofw_bus_devinfo * mrmlb_ofw_get_devinfo(device_t, device_t);
@ -128,7 +128,7 @@ mrmlb_ofw_get_devinfo(device_t bus __unused, device_t child)
}
static struct resource *
mrmlb_ofw_bus_alloc_res(device_t bus, device_t child, int type, int *rid,
mrmlb_ofw_bus_alloc_res(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)
{
struct simplebus_softc *sc;
@ -143,7 +143,7 @@ mrmlb_ofw_bus_alloc_res(device_t bus, device_t child, int type, int *rid,
type = SYS_RES_MEMORY;
/* Find defaults for this rid */
rle = resource_list_find(&di->di_rl, type, *rid);
rle = resource_list_find(&di->di_rl, type, rid);
if (rle == NULL)
return (NULL);

View file

@ -480,7 +480,7 @@ isa_claim_resources(device_t dev, device_t child)
STAILQ_FOREACH(rle, rl, link) {
if (!rle->res) {
rid = rle->rid;
resource_list_alloc(rl, dev, child, rle->type, &rid,
resource_list_alloc(rl, dev, child, rle->type, rid,
0, ~0, 1, 0);
}
}

View file

@ -69,7 +69,7 @@ struct isa_device {
*/
extern void isa_init(device_t dev);
extern struct resource *isa_alloc_resource(device_t bus, device_t child,
int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count,
int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
extern int isa_release_resource(device_t bus, device_t child,
struct resource *r);

View file

@ -43,7 +43,7 @@ INTERFACE bus;
CODE {
static struct resource *
null_alloc_resource(device_t dev, device_t child,
int type, int *rid, rman_res_t start, rman_res_t end,
int type, int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags)
{
return (0);
@ -273,16 +273,15 @@ METHOD int rescan {
*
* This method is called by child devices of a bus to allocate resources.
* The types are defined in <machine/resource.h>; the meaning of the
* resource-ID field varies from bus to bus (but @p *rid == 0 is always
* valid if the resource type is). If a resource was allocated and the
* caller did not use the RF_ACTIVE to specify that it should be
* resource-ID field varies from bus to bus. If a resource was allocated
* and the caller did not use the RF_ACTIVE to specify that it should be
* activated immediately, the caller is responsible for calling
* BUS_ACTIVATE_RESOURCE() when it actually uses the resource.
*
* @param _dev the parent device of @p _child
* @param _child the device which is requesting an allocation
* @param _type the type of resource to allocate
* @param _rid a pointer to the resource identifier
* @param _rid the resource identifier
* @param _start hint at the start of the resource range - pass
* @c 0 for any start address
* @param _end hint at the end of the resource range - pass
@ -300,7 +299,7 @@ METHOD struct resource * alloc_resource {
device_t _dev;
device_t _child;
int _type;
int *_rid;
int _rid;
rman_res_t _start;
rman_res_t _end;
rman_res_t _count;

View file

@ -3109,7 +3109,7 @@ 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);
@ -3153,7 +3153,7 @@ resource_list_reserve(struct resource_list *rl, device_t bus, device_t child,
*/
struct resource *
resource_list_alloc(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);
@ -3164,7 +3164,7 @@ resource_list_alloc(struct resource_list *rl, device_t bus, device_t child,
type, rid, start, end, count, flags));
}
rle = resource_list_find(rl, type, *rid);
rle = resource_list_find(rl, type, rid);
if (!rle)
return (NULL); /* no resource of that type/rid */
@ -3174,14 +3174,14 @@ resource_list_alloc(struct resource_list *rl, device_t bus, device_t child,
if (rle->flags & RLE_ALLOCATED)
return (NULL);
if ((flags & RF_ACTIVE) &&
bus_activate_resource(child, type, *rid,
bus_activate_resource(child, type, rid,
rle->res) != 0)
return (NULL);
rle->flags |= RLE_ALLOCATED;
return (rle->res);
}
device_printf(bus,
"resource entry %#x type %d for child %s is busy\n", *rid,
"resource entry %#x type %d for child %s is busy\n", rid,
type, device_get_nameunit(child));
return (NULL);
}
@ -4033,7 +4033,7 @@ bus_generic_translate_resource(device_t dev, int type, rman_res_t start,
* BUS_ALLOC_RESOURCE() method of the parent of @p dev.
*/
struct resource *
bus_generic_alloc_resource(device_t dev, device_t child, int type, int *rid,
bus_generic_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
/* Propagate up the bus hierarchy until someone handles it. */
@ -4324,7 +4324,7 @@ bus_generic_rl_release_resource(device_t dev, device_t child,
*/
struct resource *
bus_generic_rl_alloc_resource(device_t dev, device_t child, int type,
int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource_list * rl = NULL;
@ -4349,7 +4349,7 @@ bus_generic_rl_alloc_resource(device_t dev, device_t child, int type,
*/
struct resource *
bus_generic_rman_alloc_resource(device_t dev, device_t child, int type,
int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *r;
struct rman *rm;
@ -4362,11 +4362,11 @@ bus_generic_rman_alloc_resource(device_t dev, device_t child, int type,
child);
if (r == NULL)
return (NULL);
rman_set_rid(r, *rid);
rman_set_rid(r, rid);
rman_set_type(r, type);
if (flags & RF_ACTIVE) {
if (bus_activate_resource(child, type, *rid, r) != 0) {
if (bus_activate_resource(child, type, rid, r) != 0) {
rman_release_resource(r);
return (NULL);
}
@ -4651,7 +4651,7 @@ bus_release_resources(device_t dev, const struct resource_spec *rs,
* parent of @p dev.
*/
struct resource *
(bus_alloc_resource)(device_t dev, int type, int *rid, rman_res_t start,
(bus_alloc_resource)(device_t dev, int type, int rid, rman_res_t start,
rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *res;

View file

@ -44,7 +44,7 @@ isa_init(device_t dev)
}
struct resource *
isa_alloc_resource(device_t bus, device_t child, int type, int *rid,
isa_alloc_resource(device_t bus, device_t child, int type, int rid,
u_long start, u_long end, u_long count, u_int flags)
{
struct isa_device* idev = DEVTOISA(child);
@ -55,17 +55,17 @@ isa_alloc_resource(device_t bus, device_t child, int type, int *rid,
passthrough = (device_get_parent(child) != bus) ? 1 : 0;
if (!passthrough && !isdefault &&
resource_list_find(rl, type, *rid) == NULL) {
resource_list_find(rl, type, rid) == NULL) {
switch (type) {
case SYS_RES_IOPORT: rids = ISA_PNP_NPORT; break;
case SYS_RES_IRQ: rids = ISA_PNP_NIRQ; break;
case SYS_RES_MEMORY: rids = ISA_PNP_NMEM; break;
default: rids = 0; break;
}
if (*rid < 0 || *rid >= rids)
if (rid < 0 || rid >= rids)
return (NULL);
resource_list_add(rl, type, *rid, start, end, count);
resource_list_add(rl, type, rid, start, end, count);
}
return (resource_list_alloc(rl, bus, child, type, rid, start, end,

View file

@ -78,7 +78,7 @@ static int lbc_activate_resource(device_t bus, device_t child,
static int lbc_deactivate_resource(device_t bus, device_t child,
struct resource *r);
static struct rman *lbc_get_rman(device_t, int, u_int);
static struct resource *lbc_alloc_resource(device_t, device_t, int, int *,
static struct resource *lbc_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
static int lbc_adjust_resource(device_t, device_t, struct resource *,
rman_res_t, rman_res_t);
@ -697,7 +697,7 @@ lbc_get_rman(device_t bus, int type, u_int flags)
}
static struct resource *
lbc_alloc_resource(device_t bus, device_t child, int type, int *rid,
lbc_alloc_resource(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)
{
struct lbc_devinfo *di;
@ -721,16 +721,12 @@ lbc_alloc_resource(device_t bus, device_t child, int type, int *rid,
if (type == SYS_RES_IOPORT)
type = SYS_RES_MEMORY;
/*
* XXX: We are supposed to return a value to the user, so this
* doesn't seem right.
*/
rid = &di->di_bank;
rid = di->di_bank;
rle = resource_list_find(&di->di_res, type, *rid);
rle = resource_list_find(&di->di_res, type, rid);
if (rle == NULL) {
device_printf(bus, "no default resources for "
"rid = %d, type = %d\n", *rid, type);
"rid = %d, type = %d\n", rid, type);
return (NULL);
}
start = rle->start;

View file

@ -69,7 +69,7 @@ static int macgpio_probe(device_t);
static int macgpio_attach(device_t);
static int macgpio_print_child(device_t dev, device_t child);
static void macgpio_probe_nomatch(device_t, device_t);
static struct resource *macgpio_alloc_resource(device_t, device_t, int, int *,
static struct resource *macgpio_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
static int macgpio_activate_resource(device_t, device_t,
struct resource *);
@ -260,7 +260,7 @@ macgpio_probe_nomatch(device_t dev, device_t child)
}
static struct resource *
macgpio_alloc_resource(device_t bus, device_t child, int type, int *rid,
macgpio_alloc_resource(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)
{

View file

@ -81,7 +81,7 @@ static int macio_attach(device_t);
static int macio_print_child(device_t dev, device_t child);
static void macio_probe_nomatch(device_t, device_t);
static struct rman *macio_get_rman(device_t, int, u_int);
static struct resource *macio_alloc_resource(device_t, device_t, int, int *,
static struct resource *macio_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t,
u_int);
static int macio_adjust_resource(device_t, device_t, struct resource *,
@ -521,7 +521,7 @@ macio_get_rman(device_t bus, int type, u_int flags)
}
static struct resource *
macio_alloc_resource(device_t bus, device_t child, int type, int *rid,
macio_alloc_resource(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)
{
@ -535,10 +535,10 @@ macio_alloc_resource(device_t bus, device_t child, int type, int *rid,
case SYS_RES_MEMORY:
case SYS_RES_IOPORT:
rle = resource_list_find(&dinfo->mdi_resources, SYS_RES_MEMORY,
*rid);
rid);
if (rle == NULL) {
device_printf(bus, "no rle for %s memory %d\n",
device_get_nameunit(child), *rid);
device_get_nameunit(child), rid);
return (NULL);
}
@ -568,7 +568,7 @@ macio_alloc_resource(device_t bus, device_t child, int type, int *rid,
type, rid, start, end, count, flags);
rle = resource_list_find(&dinfo->mdi_resources, SYS_RES_IRQ,
*rid);
rid);
if (rle == NULL) {
if (dinfo->mdi_ninterrupts >= 6) {
device_printf(bus,

View file

@ -72,7 +72,7 @@ static int unin_chip_attach(device_t);
static int unin_chip_print_child(device_t dev, device_t child);
static void unin_chip_probe_nomatch(device_t, device_t);
static struct rman *unin_chip_get_rman(device_t, int, u_int);
static struct resource *unin_chip_alloc_resource(device_t, device_t, int, int *,
static struct resource *unin_chip_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t,
rman_res_t, u_int);
static int unin_chip_adjust_resource(device_t, device_t,
@ -478,7 +478,7 @@ unin_chip_get_rman(device_t bus, int type, u_int flags)
}
static struct resource *
unin_chip_alloc_resource(device_t bus, device_t child, int type, int *rid,
unin_chip_alloc_resource(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)
{
@ -492,10 +492,10 @@ unin_chip_alloc_resource(device_t bus, device_t child, int type, int *rid,
case SYS_RES_MEMORY:
case SYS_RES_IOPORT:
rle = resource_list_find(&dinfo->udi_resources, SYS_RES_MEMORY,
*rid);
rid);
if (rle == NULL) {
device_printf(bus, "no rle for %s memory %d\n",
device_get_nameunit(child), *rid);
device_get_nameunit(child), rid);
return (NULL);
}
@ -527,7 +527,7 @@ unin_chip_alloc_resource(device_t bus, device_t child, int type, int *rid,
flags);
rle = resource_list_find(&dinfo->udi_resources, SYS_RES_IRQ,
*rid);
rid);
if (rle == NULL) {
if (dinfo->udi_ninterrupts >= 6) {
device_printf(bus,

View file

@ -59,7 +59,7 @@ static int ps3bus_read_ivar(device_t bus, device_t child, int which,
uintptr_t *result);
static struct rman *ps3bus_get_rman(device_t bus, int type, u_int flags);
static struct resource *ps3bus_alloc_resource(device_t bus, device_t child,
int type, int *rid, rman_res_t start, rman_res_t end,
int type, int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
static int ps3bus_map_resource(device_t bus, device_t child,
struct resource *r, struct resource_map_request *argsp,
@ -548,7 +548,7 @@ ps3bus_get_rman(device_t bus, int type, u_int flags)
}
static struct resource *
ps3bus_alloc_resource(device_t bus, device_t child, int type, int *rid,
ps3bus_alloc_resource(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)
{
struct ps3bus_devinfo *dinfo;
@ -560,10 +560,10 @@ ps3bus_alloc_resource(device_t bus, device_t child, int type, int *rid,
switch (type) {
case SYS_RES_MEMORY:
rle = resource_list_find(&dinfo->resources, SYS_RES_MEMORY,
*rid);
rid);
if (rle == NULL) {
device_printf(bus, "no rle for %s memory %d\n",
device_get_nameunit(child), *rid);
device_get_nameunit(child), rid);
return (NULL);
}
@ -585,7 +585,7 @@ ps3bus_alloc_resource(device_t bus, device_t child, int type, int *rid,
break;
case SYS_RES_IRQ:
rle = resource_list_find(&dinfo->resources, SYS_RES_IRQ,
*rid);
rid);
adjstart = rle->start;
adjcount = ulmax(count, rle->count);
adjend = ulmax(rle->end, rle->start + adjcount - 1);

View file

@ -58,7 +58,7 @@
static int ata_iobus_attach(device_t dev);
static int ata_iobus_probe(device_t dev);
static int ata_iobus_print_child(device_t dev, device_t child);
struct resource *ata_iobus_alloc_resource(device_t, device_t, int, int *,
struct resource *ata_iobus_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t,
u_int);
static int ata_iobus_release_resource(device_t, device_t, struct resource *);
@ -129,7 +129,7 @@ ata_iobus_print_child(device_t dev, device_t child)
}
struct resource *
ata_iobus_alloc_resource(device_t dev, device_t child, int type, int *rid,
ata_iobus_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags)
{
@ -152,14 +152,14 @@ ata_iobus_alloc_resource(device_t dev, device_t child, int type, int *rid,
* The resource values are calculated from these registers
*/
if (type == SYS_RES_IOPORT) {
switch (*rid) {
switch (rid) {
case ATA_IOADDR_RID:
myrid = 0;
start = ofw_regs[4];
end = start + ATA_IOSIZE - 1;
count = ATA_IOSIZE;
res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child,
SYS_RES_MEMORY, &myrid,
SYS_RES_MEMORY, myrid,
start, end, count, flags);
break;
@ -169,7 +169,7 @@ ata_iobus_alloc_resource(device_t dev, device_t child, int type, int *rid,
end = start + ATA_CTLIOSIZE - 1;
count = ATA_CTLIOSIZE;
res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child,
SYS_RES_MEMORY, &myrid,
SYS_RES_MEMORY, myrid,
start, end, count, flags);
break;
@ -179,7 +179,7 @@ ata_iobus_alloc_resource(device_t dev, device_t child, int type, int *rid,
}
return (res);
} else if (type == SYS_RES_IRQ && *rid == ATA_IRQ_RID) {
} else if (type == SYS_RES_IRQ && rid == ATA_IRQ_RID) {
/*
* Pass this on to the parent
*/

View file

@ -71,7 +71,7 @@ static void iobus_probe_nomatch(device_t, device_t);
static int iobus_read_ivar(device_t, device_t, int, uintptr_t *);
static int iobus_write_ivar(device_t, device_t, int, uintptr_t);
static struct rman *iobus_get_rman(device_t, int, u_int);
static struct resource *iobus_alloc_resource(device_t, device_t, int, int *,
static struct resource *iobus_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t,
u_int);
static int iobus_adjust_resource(device_t, device_t, struct resource *,
@ -319,7 +319,7 @@ iobus_get_rman(device_t bus, int type, u_int flags)
}
static struct resource *
iobus_alloc_resource(device_t bus, device_t child, int type, int *rid,
iobus_alloc_resource(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)
{

View file

@ -226,7 +226,7 @@ nexus_get_rman(device_t bus, int type, u_int flags)
* child of one of our descendants, not a direct child of nexus0.
*/
static struct resource *
nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
nexus_alloc_resource(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)
{
struct nexus_device *ndev = DEVTONX(child);
@ -241,7 +241,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
if (RMAN_IS_DEFAULT_RANGE(start, end) && (count == 1)) {
if (device_get_parent(child) != bus || ndev == NULL)
return (NULL);
rle = resource_list_find(&ndev->nx_resources, type, *rid);
rle = resource_list_find(&ndev->nx_resources, type, rid);
if (rle == NULL)
return (NULL);
start = rle->start;

View file

@ -381,7 +381,7 @@ void resource_list_delete(struct resource_list *rl,
struct resource *
resource_list_alloc(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_release(struct resource_list *rl,
@ -427,7 +427,7 @@ int bus_generic_adjust_resource(device_t bus, device_t child,
rman_res_t end);
struct resource *
bus_generic_alloc_resource(device_t bus, device_t child, int type,
int *rid, rman_res_t start, rman_res_t end,
int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
int bus_generic_translate_resource(device_t dev, int type, rman_res_t start,
rman_res_t *newstart);
@ -480,7 +480,7 @@ int bus_generic_setup_intr(device_t dev, device_t child,
void *arg, void **cookiep);
struct resource *
bus_generic_rl_alloc_resource(device_t, device_t, int, int *,
bus_generic_rl_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
void bus_generic_rl_delete_resource(device_t, device_t, int, int);
int bus_generic_rl_get_resource(device_t, device_t, int, int, rman_res_t *,
@ -490,7 +490,7 @@ int bus_generic_rl_set_resource(device_t, device_t, int, int, rman_res_t,
int bus_generic_rl_release_resource(device_t, device_t, struct resource *);
struct resource *
bus_generic_rman_alloc_resource(device_t dev, device_t child, int type,
int *rid, rman_res_t start,
int rid, rman_res_t start,
rman_res_t end, rman_res_t count,
u_int flags);
int bus_generic_rman_adjust_resource(device_t dev, device_t child,
@ -544,7 +544,7 @@ int bus_adjust_resource(device_t child, struct resource *r,
rman_res_t start, rman_res_t end);
int bus_translate_resource(device_t child, int type, rman_res_t start,
rman_res_t *newstart);
struct resource *bus_alloc_resource(device_t dev, int type, int *rid,
struct resource *bus_alloc_resource(device_t dev, int type, int rid,
rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
int bus_activate_resource(device_t dev, struct resource *r);
@ -588,13 +588,13 @@ void bus_enumerate_hinted_children(device_t bus);
void bus_identify_children(device_t dev);
static __inline struct resource *
bus_alloc_resource_any(device_t dev, int type, int *rid, u_int flags)
bus_alloc_resource_any(device_t dev, int type, int rid, u_int flags)
{
return (bus_alloc_resource(dev, type, rid, 0, ~0, 1, flags));
}
static __inline struct resource *
bus_alloc_resource_anywhere(device_t dev, int type, int *rid,
bus_alloc_resource_anywhere(device_t dev, int type, int rid,
rman_res_t count, u_int flags)
{
return (bus_alloc_resource(dev, type, rid, 0, ~0, count, flags));
@ -602,44 +602,44 @@ bus_alloc_resource_anywhere(device_t dev, int type, int *rid,
/* Compat shims for bus_alloc_resource API. */
static __inline struct resource *
bus_alloc_resource_const(device_t dev, int type, int rid, rman_res_t start,
bus_alloc_resource_var(device_t dev, int type, int *rid, rman_res_t start,
rman_res_t end, rman_res_t count, u_int flags)
{
return (bus_alloc_resource(dev, type, &rid, start, end, count, flags));
return (bus_alloc_resource(dev, type, *rid, start, end, count, flags));
}
static __inline struct resource *
bus_alloc_resource_any_const(device_t dev, int type, int rid, u_int flags)
bus_alloc_resource_any_var(device_t dev, int type, int *rid, u_int flags)
{
return (bus_alloc_resource(dev, type, &rid, 0, ~0, 1, flags));
return (bus_alloc_resource(dev, type, *rid, 0, ~0, 1, flags));
}
static __inline struct resource *
bus_alloc_resource_anywhere_const(device_t dev, int type, int rid,
bus_alloc_resource_anywhere_var(device_t dev, int type, int *rid,
rman_res_t count, u_int flags)
{
return (bus_alloc_resource(dev, type, &rid, 0, ~0, count, flags));
return (bus_alloc_resource(dev, type, *rid, 0, ~0, count, flags));
}
#define bus_alloc_resource(dev, type, rid, start, end, count, flags) \
_Generic((rid), \
int *: bus_alloc_resource, \
unsigned int *: bus_alloc_resource, \
default: bus_alloc_resource_const) \
int *: bus_alloc_resource_var, \
unsigned int *: bus_alloc_resource_var, \
default: bus_alloc_resource) \
((dev), (type), (rid), (start), (end), (count), (flags))
#define bus_alloc_resource_any(dev, type, rid, flags) \
_Generic((rid), \
int *: bus_alloc_resource_any, \
unsigned int *: bus_alloc_resource_any, \
default: bus_alloc_resource_any_const) \
int *: bus_alloc_resource_any_var, \
unsigned int *: bus_alloc_resource_any_var, \
default: bus_alloc_resource_any) \
((dev), (type), (rid), (flags))
#define bus_alloc_resource_anywhere(dev, type, rid, count, flags) \
_Generic((rid), \
int *: bus_alloc_resource_anywhere, \
unsigned int *: bus_alloc_resource_anywhere, \
default: bus_alloc_resource_anywhere_const) \
int *: bus_alloc_resource_anywhere_var, \
unsigned int *: bus_alloc_resource_anywhere_var, \
default: bus_alloc_resource_anywhere) \
((dev), (type), (rid), (count), (flags))
/* Compat shims for simpler bus resource API. */

View file

@ -74,7 +74,7 @@
* cannot include sys/param.h and should only be updated here.
*/
#undef __FreeBSD_version
#define __FreeBSD_version 1600004
#define __FreeBSD_version 1600005
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

View file

@ -56,7 +56,7 @@ void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot,
int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
uintptr_t value);
struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count,
int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
int legacy_pcib_adjust_resource(device_t dev, device_t child,
struct resource *r, rman_res_t start, rman_res_t end);

View file

@ -84,7 +84,7 @@ isa_init(device_t dev)
* necessary to interpose a mapping layer here.
*/
struct resource *
isa_alloc_resource(device_t bus, device_t child, int type, int *rid,
isa_alloc_resource(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)
{
/*
@ -97,31 +97,31 @@ isa_alloc_resource(device_t bus, device_t child, int type, int *rid,
struct resource_list_entry *rle;
if (!passthrough && !isdefault) {
rle = resource_list_find(rl, type, *rid);
rle = resource_list_find(rl, type, rid);
if (!rle) {
if (*rid < 0)
if (rid < 0)
return 0;
switch (type) {
case SYS_RES_IRQ:
if (*rid >= ISA_NIRQ)
if (rid >= ISA_NIRQ)
return 0;
break;
case SYS_RES_DRQ:
if (*rid >= ISA_NDRQ)
if (rid >= ISA_NDRQ)
return 0;
break;
case SYS_RES_MEMORY:
if (*rid >= ISA_NMEM)
if (rid >= ISA_NMEM)
return 0;
break;
case SYS_RES_IOPORT:
if (*rid >= ISA_NPORT)
if (rid >= ISA_NPORT)
return 0;
break;
default:
return 0;
}
resource_list_add(rl, type, *rid, start, end, count);
resource_list_add(rl, type, rid, start, end, count);
}
}

View file

@ -592,7 +592,7 @@ hostb_alloc_start(int type, rman_res_t start, rman_res_t end, rman_res_t count)
}
struct resource *
legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{

View file

@ -249,7 +249,7 @@ qpi_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
}
static struct resource *
qpi_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
qpi_pcib_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{

View file

@ -96,7 +96,7 @@ mptable_is_vga_range(rman_res_t start, rman_res_t end)
}
static struct resource *
mptable_hostb_alloc_resource(device_t dev, device_t child, int type, int *rid,
mptable_hostb_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct mptable_hostb_softc *sc;

View file

@ -345,7 +345,7 @@ nexus_get_rman(device_t bus, int type, u_int flags)
* child of one of our descendants, not a direct child of nexus0.
*/
static struct resource *
nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
nexus_alloc_resource(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)
{
@ -361,7 +361,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
if (RMAN_IS_DEFAULT_RANGE(start, end) && (count == 1)) {
if (device_get_parent(child) != bus || ndev == NULL)
return (NULL);
rle = resource_list_find(&ndev->nx_resources, type, *rid);
rle = resource_list_find(&ndev->nx_resources, type, rid);
if (rle == NULL)
return (NULL);
start = rle->start;