Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.

On some architectures, u_long isn't large enough for resource definitions.
Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but
type `long' is only 32-bit.  This extends rman's resources to uintmax_t.  With
this change, any resource can feasibly be placed anywhere in physical memory
(within the constraints of the driver).

Why uintmax_t and not something machine dependent, or uint64_t?  Though it's
possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on
32-bit architectures.  64-bit architectures should have plenty of RAM to absorb
the increase on resource sizes if and when this occurs, and the number of
resources on memory-constrained systems should be sufficiently small as to not
pose a drastic overhead.  That being said, uintmax_t was chosen for source
clarity.  If it's specified as uint64_t, all printf()-like calls would either
need casts to uintmax_t, or be littered with PRI*64 macros.  Casts to uintmax_t
aren't horrible, but it would also bake into the API for
resource_list_print_type() either a hidden assumption that entries get cast to
uintmax_t for printing, or these calls would need the PRI*64 macros.  Since
source code is meant to be read more often than written, I chose the clearest
path of simply using uintmax_t.

Tested on a PowerPC p5020-based board, which places all device resources in
0xfxxxxxxxx, and has 8GB RAM.
Regression tested on qemu-system-i386
Regression tested on qemu-system-mips (malta profile)

Tested PAE and devinfo on virtualbox (live CD)

Special thanks to bz for his testing on ARM.

Reviewed By: bz, jhb (previous)
Relnotes:	Yes
Sponsored by:	Alex Perez/Inertial Computing
Differential Revision: https://reviews.freebsd.org/D4544
This commit is contained in:
jhibbits 2016-03-18 01:28:41 +00:00
parent af520aec51
commit 720f47c9ed
76 changed files with 204 additions and 197 deletions

View File

@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
20160317:
Resource range types have grown from unsigned long to uintmax_t. All
drivers, and anything using libdevinfo, need to be recompiled.
20160311:
WITH_FAST_DEPEND is now enabled by default for in-tree and out-of-tree
builds. It no longer runs mkdep(1) during 'make depend', and the

View File

@ -287,7 +287,7 @@ ata_avila_alloc_resource(device_t dev, device_t child, int type, int *rid,
struct ata_avila_softc *sc = device_get_softc(dev);
KASSERT(type == SYS_RES_IRQ && *rid == ATA_IRQ_RID,
("type %u rid %u start %lu end %lu count %lu flags %u",
("type %u rid %u start %ju end %ju count %ju flags %u",
type, *rid, start, end, count, flags));
/* doesn't matter what we return so reuse the real thing */

View File

@ -533,7 +533,7 @@ ixp425_alloc_resource(device_t dev, device_t child, int type, int *rid,
(start - vtrans->hwbase);
if (bootverbose)
device_printf(child,
"%s: assign 0x%lx:0x%lx%s\n",
"%s: assign 0x%jx:0x%jx%s\n",
__func__, start, end - start,
vtrans->isa4x ? " A4X" :
vtrans->isslow ? " SLOW" : "");
@ -542,14 +542,14 @@ ixp425_alloc_resource(device_t dev, device_t child, int type, int *rid,
vtrans = gethwvtrans(start, end - start);
if (vtrans == NULL) {
/* likely means above table needs to be updated */
device_printf(child, "%s: no mapping for 0x%lx:0x%lx\n",
device_printf(child, "%s: no mapping for 0x%jx:0x%jx\n",
__func__, start, end - start);
return NULL;
}
rv = rman_reserve_resource(&sc->sc_mem_rman, start, end,
end - start, flags, child);
if (rv == NULL) {
device_printf(child, "%s: cannot reserve 0x%lx:0x%lx\n",
device_printf(child, "%s: cannot reserve 0x%jx:0x%jx\n",
__func__, start, end - start);
return NULL;
}
@ -586,7 +586,7 @@ ixp425_activate_resource(device_t dev, device_t child, int type, int rid,
if (type == SYS_RES_MEMORY) {
vtrans = gethwvtrans(rman_get_start(r), rman_get_size(r));
if (vtrans == NULL) { /* NB: should not happen */
device_printf(child, "%s: no mapping for 0x%lx:0x%lx\n",
device_printf(child, "%s: no mapping for 0x%jx:0x%jx\n",
__func__, rman_get_start(r), rman_get_size(r));
return (ENOENT);
}

View File

@ -390,7 +390,7 @@ pxa_alloc_gpio_irq(device_t dev, device_t child, int type, int *rid,
}
if (bootverbose)
device_printf(dev, "lazy allocation of irq %ld for %s\n",
device_printf(dev, "lazy allocation of irq %jd for %s\n",
start, device_get_nameunit(child));
return (rv);

View File

@ -348,13 +348,13 @@ ndis_create_sysctls(arg)
ndis_add_sysctl(sc, "BusType", "Bus Type", buf, NDIS_FLAG_RDONLY);
if (sc->ndis_res_io != NULL) {
sprintf(buf, "0x%lx", rman_get_start(sc->ndis_res_io));
sprintf(buf, "0x%jx", rman_get_start(sc->ndis_res_io));
ndis_add_sysctl(sc, "IOBaseAddress",
"Base I/O Address", buf, NDIS_FLAG_RDONLY);
}
if (sc->ndis_irq != NULL) {
sprintf(buf, "%lu", rman_get_start(sc->ndis_irq));
sprintf(buf, "%ju", rman_get_start(sc->ndis_irq));
ndis_add_sysctl(sc, "InterruptNumber",
"Interrupt Number", buf, NDIS_FLAG_RDONLY);
}

View File

@ -795,10 +795,10 @@ acpi_print_child(device_t bus, device_t child)
int retval = 0;
retval += bus_print_child_header(bus, child);
retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx");
retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx");
retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld");
retval += resource_list_print_type(rl, "drq", SYS_RES_DRQ, "%ld");
retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#jx");
retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#jx");
retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd");
retval += resource_list_print_type(rl, "drq", SYS_RES_DRQ, "%jd");
if (device_get_flags(child))
retval += printf(" flags %#x", device_get_flags(child));
retval += bus_print_child_domain(bus, child);
@ -1156,7 +1156,7 @@ acpi_sysres_alloc(device_t dev)
rl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev);
STAILQ_FOREACH(rle, rl, link) {
if (rle->res != NULL) {
device_printf(dev, "duplicate resource for %lx\n", rle->start);
device_printf(dev, "duplicate resource for %jx\n", rle->start);
continue;
}
@ -1179,7 +1179,7 @@ acpi_sysres_alloc(device_t dev)
rman_manage_region(rm, rman_get_start(res), rman_get_end(res));
rle->res = res;
} else if (bootverbose)
device_printf(dev, "reservation of %lx, %lx (%d) failed\n",
device_printf(dev, "reservation of %jx, %jx (%d) failed\n",
rle->start, rle->count, rle->type);
}
return (0);

View File

@ -453,7 +453,7 @@ hpet_attach(device_t dev)
/* Validate that we can access the whole region. */
if (rman_get_size(sc->mem_res) < HPET_MEM_WIDTH) {
device_printf(dev, "memory region width %ld too small\n",
device_printf(dev, "memory region width %jd too small\n",
rman_get_size(sc->mem_res));
bus_free_resource(dev, SYS_RES_MEMORY, sc->mem_res);
return (ENXIO);

View File

@ -152,7 +152,7 @@ acpi_timer_identify(driver_t *driver, device_t parent)
rlen = AcpiGbl_FADT.PmTimerLength;
rstart = AcpiGbl_FADT.XPmTimerBlock.Address;
if (bus_set_resource(dev, rtype, rid, rstart, rlen))
device_printf(dev, "couldn't set resource (%s 0x%lx+0x%lx)\n",
device_printf(dev, "couldn't set resource (%s 0x%jx+0x%jx)\n",
(rtype == SYS_RES_IOPORT) ? "port" : "mem", rstart, rlen);
return_VOID;
}

View File

@ -136,7 +136,7 @@ adv_isa_probe(device_t dev)
|| (iobase != adv_isa_ioports[port_index])) {
if (bootverbose)
device_printf(dev,
"Invalid baseport of 0x%lx specified. "
"Invalid baseport of 0x%jx specified. "
"Nearest valid baseport is 0x%x. Failing "
"probe.\n", iobase,
(port_index <= max_port_index) ?

View File

@ -63,7 +63,7 @@ atkbdc_print_child(device_t bus, device_t dev)
retval += printf(" flags 0x%x", flags);
irq = bus_get_resource_start(dev, SYS_RES_IRQ, kbdcdev->rid);
if (irq != 0)
retval += printf(" irq %ld", irq);
retval += printf(" irq %jd", irq);
retval += bus_print_child_footer(bus, dev);
return (retval);

View File

@ -12845,7 +12845,7 @@ bxe_allocate_bars(struct bxe_softc *sc)
sc->bar[i].handle = rman_get_bushandle(sc->bar[i].resource);
sc->bar[i].kva = (vm_offset_t)rman_get_virtual(sc->bar[i].resource);
BLOGI(sc, "PCI BAR%d [%02x] memory allocated: %p-%p (%ld) -> %p\n",
BLOGI(sc, "PCI BAR%d [%02x] memory allocated: %p-%p (%jd) -> %p\n",
i, PCIR_BAR(i),
(void *)rman_get_start(sc->bar[i].resource),
(void *)rman_get_end(sc->bar[i].resource),

View File

@ -485,7 +485,8 @@ cardbus_read_tuple_init(device_t cbdev, device_t child, uint32_t *start,
"to read CIS.\n");
return (NULL);
}
DEVPRINTF((cbdev, "CIS Mapped to %#lx\n", rman_get_start(res)));
DEVPRINTF((cbdev, "CIS Mapped to %#jx\n",
rman_get_start(res)));
/* Flip to the right ROM image if CIS is in ROM */
if (space == PCIM_CIS_ASI_ROM) {

View File

@ -459,7 +459,7 @@ static int ct_probe (device_t dev)
}
if (!ct_probe_board (iobase, -1, -1)) {
printf ("ct%d: probing for Tau-ISA at %lx faild\n", unit, iobase);
printf ("ct%d: probing for Tau-ISA at %jx faild\n", unit, iobase);
return ENXIO;
}
@ -632,7 +632,7 @@ static int ct_attach (device_t dev)
ct_ln[2] = '0' + unit;
mtx_init (&bd->ct_mtx, ct_ln, MTX_NETWORK_LOCK, MTX_DEF|MTX_RECURSE);
if (! probe_irq (b, irq)) {
printf ("ct%d: irq %ld not functional\n", unit, irq);
printf ("ct%d: irq %jd not functional\n", unit, irq);
bd->board = 0;
adapter [unit] = 0;
free (b, M_DEVBUF);
@ -651,7 +651,7 @@ static int ct_attach (device_t dev)
if (bus_setup_intr (dev, bd->irq_res,
INTR_TYPE_NET|INTR_MPSAFE,
NULL, ct_intr, bd, &bd->intrhand)) {
printf ("ct%d: Can't setup irq %ld\n", unit, irq);
printf ("ct%d: Can't setup irq %jd\n", unit, irq);
bd->board = 0;
adapter [unit] = 0;
free (b, M_DEVBUF);

View File

@ -324,7 +324,7 @@ ed_probe_3Com(device_t dev, int port_rid, int flags)
ed_asic_outb(sc, ED_3COM_IDCFR, ED_3COM_IDCFR_IRQ5);
break;
default:
device_printf(dev, "Invalid irq configuration (%ld) must be 3-5,9 for 3c503\n",
device_printf(dev, "Invalid irq configuration (%jd) must be 3-5,9 for 3c503\n",
irq);
return (ENXIO);
}

View File

@ -1021,7 +1021,7 @@ ed_probe_CNET98(device_t dev, int port_rid, int flags)
if (((rman_get_start(sc->port_res) & 0x0fff) != 0x03d0)
|| ((rman_get_start(sc->port_res) & 0xf000) < (u_short) 0xa000)) {
#ifdef DIAGNOSTIC
device_printf(dev, "Invalid i/o port configuration (0x%lx) "
device_printf(dev, "Invalid i/o port configuration (0x%jx) "
"must be %s for %s\n", rman_get_start(sc->port_res),
"0x[a-f]3d0", "CNET98");
#endif
@ -1032,7 +1032,7 @@ ed_probe_CNET98(device_t dev, int port_rid, int flags)
/* Check window area address */
tmp_s = rman_get_start(sc->mem_res) >> 12;
if (tmp_s < 0x80) {
device_printf(dev, "Please change window address(0x%lx)\n",
device_printf(dev, "Please change window address(0x%jx)\n",
rman_get_start(sc->mem_res));
return (ENXIO);
}
@ -1040,8 +1040,8 @@ ed_probe_CNET98(device_t dev, int port_rid, int flags)
tmp_s &= 0x0f;
tmp = rman_get_start(sc->port_res) >> 12;
if ((tmp_s <= tmp) && (tmp < (tmp_s + 4))) {
device_printf(dev, "Please change iobase address(0x%lx) "
"or window address(0x%lx)\n",
device_printf(dev, "Please change iobase address(0x%jx) "
"or window address(0x%jx)\n",
rman_get_start(sc->port_res),
rman_get_start(sc->mem_res));
return (ENXIO);
@ -1128,7 +1128,7 @@ ed_probe_CNET98(device_t dev, int port_rid, int flags)
tmp = ED_CNET98_INT_IRQ13;
break;
default:
device_printf(dev, "Invalid irq configuration (%ld) must be "
device_printf(dev, "Invalid irq configuration (%jd) must be "
"%s for %s\n", conf_irq, "3,5,6,9,12,13", "CNET98");
return (ENXIO);
}
@ -1169,7 +1169,7 @@ ed_probe_CNET98EL(device_t dev, int port_rid, int flags)
/* Check I/O address. 0x[0-f]3d0 are allowed. */
if ((rman_get_start(sc->port_res) & 0x0fff) != 0x03d0) {
#ifdef DIAGNOSTIC
device_printf(dev, "Invalid i/o port configuration (0x%lx) "
device_printf(dev, "Invalid i/o port configuration (0x%jx) "
"must be %s for %s\n", rman_get_start(sc->port_res),
"0x?3d0", "CNET98E/L");
#endif
@ -1223,7 +1223,7 @@ ed_probe_CNET98EL(device_t dev, int port_rid, int flags)
break;
#endif
default:
device_printf(dev, "Invalid irq configuration (%ld) must be "
device_printf(dev, "Invalid irq configuration (%jd) must be "
"%s for %s\n", conf_irq, "3,5,6", "CNET98E/L");
return (ENXIO);
}
@ -1285,7 +1285,7 @@ ed_probe_NEC77(device_t dev, int port_rid, int flags)
tmp = ED_NEC77_IRQ13;
break;
default:
device_printf(dev, "Invalid irq configuration (%ld) must be "
device_printf(dev, "Invalid irq configuration (%jd) must be "
"%s for %s\n", conf_irq, "3,5,6,12,13", "PC-9801-77");
return (ENXIO);
}
@ -1337,7 +1337,7 @@ ed_probe_NW98X(device_t dev, int port_rid, int flags)
tmp = ED_NW98X_IRQ13;
break;
default:
device_printf(dev, "Invalid irq configuration (%ld) must be "
device_printf(dev, "Invalid irq configuration (%jd) must be "
"%s for %s\n", conf_irq, "3,5,6,12,13", "EC/EP-98X");
return (ENXIO);
}
@ -1439,7 +1439,7 @@ ed_probe_SB98(device_t dev, int port_rid, int flags)
/* Check I/O address. 00d[02468ace] are allowed. */
if ((rman_get_start(sc->port_res) & ~0x000e) != 0x00d0) {
#ifdef DIAGNOSTIC
device_printf(dev, "Invalid i/o port configuration (0x%lx) "
device_printf(dev, "Invalid i/o port configuration (0x%jx) "
"must be %s for %s\n", rman_get_start(sc->port_res),
"0xd?", "SB9801");
#endif
@ -1475,7 +1475,7 @@ ed_probe_SB98(device_t dev, int port_rid, int flags)
tmp = ED_SB98_CFG_IRQ12;
break;
default:
device_printf(dev, "Invalid irq configuration (%ld) must be "
device_printf(dev, "Invalid irq configuration (%jd) must be "
"%s for %s\n", conf_irq, "3,5,6,12", "SB9801");
return (ENXIO);
}

View File

@ -369,7 +369,7 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid,
if (j == sc->nranges && sc->nranges != 0) {
if (bootverbose)
device_printf(bus, "Could not map resource "
"%#lx-%#lx\n", start, end);
"%#jx-%#jx\n", start, end);
return (NULL);
}
@ -387,8 +387,8 @@ simplebus_print_res(struct simplebus_devinfo *di)
if (di == NULL)
return (0);
rv = 0;
rv += resource_list_print_type(&di->rl, "mem", SYS_RES_MEMORY, "%#lx");
rv += resource_list_print_type(&di->rl, "irq", SYS_RES_IRQ, "%ld");
rv += resource_list_print_type(&di->rl, "mem", SYS_RES_MEMORY, "%#jx");
rv += resource_list_print_type(&di->rl, "irq", SYS_RES_IRQ, "%jd");
return (rv);
}

View File

@ -228,7 +228,7 @@ iir_pci_attach(device_t dev)
/* check and reset interface area */
bus_write_4(gdt->sc_dpmem, GDT_MPR_IC, htole32(GDT_MPR_MAGIC));
if (bus_read_4(gdt->sc_dpmem, GDT_MPR_IC) != htole32(GDT_MPR_MAGIC)) {
device_printf(dev, "cannot access DPMEM at 0x%lx (shadowed?)\n",
device_printf(dev, "cannot access DPMEM at 0x%jx (shadowed?)\n",
rman_get_start(gdt->sc_dpmem));
error = ENXIO;
goto err;

View File

@ -365,11 +365,11 @@ mca_print_child (device_t dev, device_t child)
rid = 0;
while ((rle = resource_list_find(&(m_dev->rl), SYS_RES_IOPORT, rid++))) {
if (rle->count == 1) {
snprintf(buf, sizeof(buf), "%s%lx",
snprintf(buf, sizeof(buf), "%s%jx",
((rid == 1) ? "io 0x" : "0x"),
rle->start);
} else {
snprintf(buf, sizeof(buf), "%s%lx-0x%lx",
snprintf(buf, sizeof(buf), "%s%jx-0x%jx",
((rid == 1) ? "io 0x" : "0x"),
rle->start,
(rle->start + rle->count));
@ -381,11 +381,11 @@ mca_print_child (device_t dev, device_t child)
rid = 0;
while ((rle = resource_list_find(&(m_dev->rl), SYS_RES_MEMORY, rid++))) {
if (rle->count == 1) {
snprintf(buf, sizeof(buf), "%s%lx",
snprintf(buf, sizeof(buf), "%s%jx",
((rid == 1) ? "mem 0x" : "0x"),
rle->start);
} else {
snprintf(buf, sizeof(buf), "%s%lx-0x%lx",
snprintf(buf, sizeof(buf), "%s%jx-0x%jx",
((rid == 1) ? "mem 0x" : "0x"),
rle->start,
(rle->start + rle->count));
@ -396,14 +396,14 @@ mca_print_child (device_t dev, device_t child)
rid = 0;
while ((rle = resource_list_find(&(m_dev->rl), SYS_RES_IRQ, rid++))) {
snprintf(buf, sizeof(buf), "irq %ld", rle->start);
snprintf(buf, sizeof(buf), "irq %jd", rle->start);
mca_reg_print(child, buf,
((rid == 1) ? &separator : NULL), &column);
}
rid = 0;
while ((rle = resource_list_find(&(m_dev->rl), SYS_RES_DRQ, rid++))) {
snprintf(buf, sizeof(buf), "drq %lx", rle->start);
snprintf(buf, sizeof(buf), "drq %jx", rle->start);
mca_reg_print(child, buf,
((rid == 1) ? &separator : NULL), &column);
}

View File

@ -4612,7 +4612,7 @@ mxge_add_msix_irqs(mxge_softc_t *sc)
device_printf(sc->dev, "using %d msix IRQs:",
sc->num_slices);
for (i = 0; i < sc->num_slices; i++)
printf(" %ld", rman_get_start(sc->msix_irq_res[i]));
printf(" %jd", rman_get_start(sc->msix_irq_res[i]));
printf("\n");
}
return (0);
@ -4668,7 +4668,7 @@ mxge_add_single_irq(mxge_softc_t *sc)
return ENXIO;
}
if (mxge_verbose)
device_printf(sc->dev, "using %s irq %ld\n",
device_printf(sc->dev, "using %s irq %jd\n",
sc->legacy_irq ? "INTx" : "MSI",
rman_get_start(sc->irq_res));
err = bus_setup_intr(sc->dev, sc->irq_res,
@ -4823,7 +4823,7 @@ mxge_attach(device_t dev)
sc->sram = rman_get_virtual(sc->mem_res);
sc->sram_size = 2*1024*1024 - (2*(48*1024)+(32*1024)) - 0x100;
if (sc->sram_size > rman_get_size(sc->mem_res)) {
device_printf(dev, "impossible memory region size %ld\n",
device_printf(dev, "impossible memory region size %jd\n",
rman_get_size(sc->mem_res));
err = ENXIO;
goto abort_with_mem_res;

View File

@ -200,8 +200,8 @@ ofwbus_alloc_resource(device_t bus, device_t child, int type, int *rid,
return (NULL);
}
start = rle->start;
count = ulmax(count, rle->count);
end = ulmax(rle->end, start + count - 1);
count = ummax(count, rle->count);
end = ummax(rle->end, start + count - 1);
}
switch (type) {

View File

@ -507,7 +507,7 @@ pccard_function_init(struct pccard_function *pf, int entry)
end = start + ios->length - 1;
else
end = ~0;
DEVPRINTF((bus, "I/O rid %d start %#lx end %#lx\n",
DEVPRINTF((bus, "I/O rid %d start %#jx end %#jx\n",
i, start, end));
rid = i;
len = ios->length;
@ -531,7 +531,7 @@ pccard_function_init(struct pccard_function *pf, int entry)
end = start + mems->length - 1;
else
end = ~0;
DEVPRINTF((bus, "Memory rid %d start %#lx end %#lx\ncardaddr %#lx hostaddr %#lx length %#lx\n",
DEVPRINTF((bus, "Memory rid %d start %#jx end %#jx\ncardaddr %#jx hostaddr %#jx length %#jx\n",
i, start, end, mems->cardaddr, mems->hostaddr,
mems->length));
rid = i;
@ -602,7 +602,7 @@ pccard_function_free(struct pccard_function *pf)
device_printf(pf->sc->dev,
"function_free: Resource still owned by "
"child, oops. "
"(type=%d, rid=%d, addr=%#lx)\n",
"(type=%d, rid=%d, addr=%#jx)\n",
rle->type, rle->rid,
rman_get_start(rle->res));
BUS_RELEASE_RESOURCE(device_get_parent(pf->sc->dev),
@ -697,7 +697,7 @@ pccard_function_enable(struct pccard_function *pf)
&pf->ccr_rid, PCCARD_MEM_PAGE_SIZE, RF_ACTIVE);
if (!pf->ccr_res)
goto bad;
DEVPRINTF((dev, "ccr_res == %#lx-%#lx, base=%#x\n",
DEVPRINTF((dev, "ccr_res == %#jx-%#jx, base=%#x\n",
rman_get_start(pf->ccr_res), rman_get_end(pf->ccr_res),
pf->ccr_base));
CARD_SET_RES_FLAGS(device_get_parent(dev), dev, SYS_RES_MEMORY,
@ -1197,7 +1197,7 @@ pccard_release_resource(device_t dev, device_t child, int type, int rid,
if (!rle) {
device_printf(dev, "Allocated resource not found, "
"%d %#x %#lx %#lx\n",
"%d %#x %#jx %#jx\n",
type, rid, rman_get_start(r), rman_get_size(r));
return ENOENT;
}

View File

@ -151,7 +151,7 @@ pccard_scan_cis(device_t bus, device_t dev, pccard_scan_t fct, void *arg)
tuple.memh = rman_get_bushandle(res);
tuple.ptr = 0;
DPRINTF(("cis mem map %#x (resource: %#lx)\n",
DPRINTF(("cis mem map %#x (resource: %#jx)\n",
(unsigned int) tuple.memh, rman_get_start(res)));
tuple.mult = 2;
@ -576,9 +576,9 @@ pccard_print_cis(device_t dev)
printf("; iomask %#lx, iospace", cfe->iomask);
for (i = 0; i < cfe->num_iospace; i++) {
printf(" %#lx", cfe->iospace[i].start);
printf(" %#jx", cfe->iospace[i].start);
if (cfe->iospace[i].length)
printf("-%#lx",
printf("-%#jx",
cfe->iospace[i].start +
cfe->iospace[i].length - 1);
}
@ -587,14 +587,14 @@ pccard_print_cis(device_t dev)
printf("; memspace");
for (i = 0; i < cfe->num_memspace; i++) {
printf(" %#lx",
printf(" %#jx",
cfe->memspace[i].cardaddr);
if (cfe->memspace[i].length)
printf("-%#lx",
printf("-%#jx",
cfe->memspace[i].cardaddr +
cfe->memspace[i].length - 1);
if (cfe->memspace[i].hostaddr)
printf("@%#lx",
printf("@%#jx",
cfe->memspace[i].hostaddr);
}
}

View File

@ -229,7 +229,7 @@ cbb_destroy_res(struct cbb_softc *sc)
while ((rle = SLIST_FIRST(&sc->rl)) != NULL) {
device_printf(sc->dev, "Danger Will Robinson: Resource "
"left allocated! This is a bug... "
"(rid=%x, type=%d, addr=%lx)\n", rle->rid, rle->type,
"(rid=%x, type=%d, addr=%jx)\n", rle->rid, rle->type,
rman_get_start(rle->res));
SLIST_REMOVE_HEAD(&sc->rl, link);
free(rle, M_DEVBUF);
@ -1241,8 +1241,8 @@ cbb_cardbus_alloc_resource(device_t brdev, device_t child, int type,
case SYS_RES_IRQ:
tmp = rman_get_start(sc->irq_res);
if (start > tmp || end < tmp || count != 1) {
device_printf(child, "requested interrupt %ld-%ld,"
"count = %ld not supported by cbb\n",
device_printf(child, "requested interrupt %jd-%jd,"
"count = %jd not supported by cbb\n",
start, end, count);
return (NULL);
}
@ -1425,8 +1425,8 @@ cbb_pcic_alloc_resource(device_t brdev, device_t child, int type, int *rid,
case SYS_RES_IRQ:
tmp = rman_get_start(sc->irq_res);
if (start > tmp || end < tmp || count != 1) {
device_printf(child, "requested interrupt %ld-%ld,"
"count = %ld not supported by cbb\n",
device_printf(child, "requested interrupt %jd-%jd,"
"count = %jd not supported by cbb\n",
start, end, count);
return (NULL);
}

View File

@ -313,7 +313,7 @@ cbb_pci_attach(device_t brdev)
mtx_destroy(&sc->mtx);
return (ENOMEM);
} else {
DEVPRINTF((brdev, "Found memory at %08lx\n",
DEVPRINTF((brdev, "Found memory at %jx\n",
rman_get_start(sc->base_res)));
}

View File

@ -1643,7 +1643,7 @@ pci_alloc_msix_method(device_t dev, device_t child, int *count)
if (bootverbose) {
rle = resource_list_find(&dinfo->resources, SYS_RES_IRQ, 1);
if (actual == 1)
device_printf(child, "using IRQ %lu for MSI-X\n",
device_printf(child, "using IRQ %ju for MSI-X\n",
rle->start);
else {
int run;
@ -1653,7 +1653,7 @@ pci_alloc_msix_method(device_t dev, device_t child, int *count)
* IRQ values as ranges. 'irq' is the previous IRQ.
* 'run' is true if we are in a range.
*/
device_printf(child, "using IRQs %lu", rle->start);
device_printf(child, "using IRQs %ju", rle->start);
irq = rle->start;
run = 0;
for (i = 1; i < actual; i++) {
@ -1674,7 +1674,7 @@ pci_alloc_msix_method(device_t dev, device_t child, int *count)
}
/* Start new range. */
printf(",%lu", rle->start);
printf(",%ju", rle->start);
irq = rle->start;
}
@ -3572,13 +3572,13 @@ pci_alloc_secbus(device_t dev, device_t child, int *rid, rman_res_t start,
start, end, count, flags & ~RF_ACTIVE);
if (res == NULL) {
resource_list_delete(rl, PCI_RES_BUS, *rid);
device_printf(child, "allocating %lu bus%s failed\n",
device_printf(child, "allocating %ju bus%s failed\n",
count, count == 1 ? "" : "es");
return (NULL);
}
if (bootverbose)
device_printf(child,
"Lazy allocation of %lu bus%s at %lu\n", count,
"Lazy allocation of %ju bus%s at %ju\n", count,
count == 1 ? "" : "es", rman_get_start(res));
PCI_WRITE_CONFIG(dev, child, sec_reg, rman_get_start(res), 1);
PCI_WRITE_CONFIG(dev, child, sub_reg, rman_get_end(res), 1);
@ -4391,9 +4391,9 @@ pci_print_child(device_t dev, device_t child)
retval += bus_print_child_header(dev, child);
retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx");
retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx");
retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld");
retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#jx");
retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx");
retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd");
if (device_get_flags(dev))
retval += printf(" flags %#x", device_get_flags(dev));
@ -4971,13 +4971,13 @@ pci_reserve_map(device_t dev, device_t child, int type, int *rid,
if (res == NULL) {
resource_list_delete(rl, type, *rid);
device_printf(child,
"%#lx bytes of rid %#x res %d failed (%#lx, %#lx).\n",
"%#jx bytes of rid %#x res %d failed (%#jx, %#jx).\n",
count, *rid, type, start, end);
goto out;
}
if (bootverbose)
device_printf(child,
"Lazy allocation of %#lx bytes rid %#x type %d at %#lx\n",
"Lazy allocation of %#jx bytes rid %#x type %d at %#jx\n",
count, *rid, type, rman_get_start(res));
map = rman_get_start(res);
pci_write_bar(child, pm, map);
@ -5254,7 +5254,7 @@ pci_delete_resource(device_t dev, device_t child, int type, int rid)
resource_list_busy(rl, type, rid)) {
device_printf(dev, "delete_resource: "
"Resource still owned by child, oops. "
"(type=%d, rid=%d, addr=%lx)\n",
"(type=%d, rid=%d, addr=%jx)\n",
type, rid, rman_get_start(rle->res));
return;
}

View File

@ -247,7 +247,7 @@ pcib_is_isa_range(struct pcib_softc *sc, rman_res_t start, rman_res_t end,
alias:
if (bootverbose)
device_printf(sc->dev,
"I/O range %#lx-%#lx overlaps with an ISA alias\n", start,
"I/O range %#jx-%#jx overlaps with an ISA alias\n", start,
end);
return (1);
}
@ -339,7 +339,7 @@ alloc_ranges(rman_res_t start, rman_res_t end, void *arg)
rid = w->reg;
if (bootverbose)
device_printf(as->sc->dev,
"allocating non-ISA range %#lx-%#lx\n", start, end);
"allocating non-ISA range %#jx-%#jx\n", start, end);
as->res[as->count] = bus_alloc_resource(as->sc->dev, SYS_RES_IOPORT,
&rid, start, end, end - start + 1, 0);
if (as->res[as->count] == NULL)
@ -621,7 +621,7 @@ pcib_suballoc_bus(struct pcib_secbus *bus, device_t child, int *rid,
if (bootverbose)
device_printf(bus->dev,
"allocated bus range (%lu-%lu) for rid %d of %s\n",
"allocated bus range (%ju-%ju) for rid %d of %s\n",
rman_get_start(res), rman_get_end(res), *rid,
pcib_child_name(child));
rman_set_rid(res, *rid);
@ -646,7 +646,7 @@ pcib_grow_subbus(struct pcib_secbus *bus, rman_res_t new_end)
if (error)
return (error);
if (bootverbose)
device_printf(bus->dev, "grew bus range to %lu-%lu\n",
device_printf(bus->dev, "grew bus range to %ju-%ju\n",
rman_get_start(bus->res), rman_get_end(bus->res));
error = rman_manage_region(&bus->rman, old_end + 1,
rman_get_end(bus->res));
@ -694,8 +694,8 @@ pcib_alloc_subbus(struct pcib_secbus *bus, device_t child, int *rid,
/* Finally, attempt to grow the existing resource. */
if (bootverbose) {
device_printf(bus->dev,
"attempting to grow bus range for %lu buses\n", count);
printf("\tback candidate range: %lu-%lu\n", start_free,
"attempting to grow bus range for %ju buses\n", count);
printf("\tback candidate range: %ju-%ju\n", start_free,
new_end);
}
if (pcib_grow_subbus(bus, new_end) == 0)
@ -1174,7 +1174,7 @@ pcib_suballoc_resource(struct pcib_softc *sc, struct pcib_window *w,
if (bootverbose)
device_printf(sc->dev,
"allocated %s range (%#lx-%#lx) for rid %x of %s\n",
"allocated %s range (%#jx-%#jx) for rid %x of %s\n",
w->name, rman_get_start(res), rman_get_end(res), *rid,
pcib_child_name(child));
rman_set_rid(res, *rid);
@ -1401,7 +1401,7 @@ pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type,
if (error) {
if (bootverbose)
device_printf(sc->dev,
"failed to allocate initial %s window (%#lx-%#lx,%#lx)\n",
"failed to allocate initial %s window (%#jx-%#jx,%#jx)\n",
w->name, start, end, count);
return (error);
}
@ -1433,7 +1433,7 @@ pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type,
*/
if (bootverbose)
device_printf(sc->dev,
"attempting to grow %s window for (%#lx-%#lx,%#lx)\n",
"attempting to grow %s window for (%#jx-%#jx,%#jx)\n",
w->name, start, end, count);
align = (rman_res_t)1 << RF_ALIGNMENT(flags);
if (start < w->base) {
@ -1457,7 +1457,7 @@ pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type,
*/
if (front >= start && front <= end_free) {
if (bootverbose)
printf("\tfront candidate range: %#lx-%#lx\n",
printf("\tfront candidate range: %#jx-%#jx\n",
front, end_free);
front &= ~wmask;
front = w->base - front;
@ -1485,7 +1485,7 @@ pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type,
*/
if (back <= end && start_free <= back) {
if (bootverbose)
printf("\tback candidate range: %#lx-%#lx\n",
printf("\tback candidate range: %#jx-%#jx\n",
start_free, back);
back |= wmask;
back -= w->limit;
@ -1709,7 +1709,7 @@ pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
#endif
}
if (end < start) {
device_printf(dev, "ioport: end (%lx) < start (%lx)\n",
device_printf(dev, "ioport: end (%jx) < start (%jx)\n",
end, start);
start = 0;
end = 0;
@ -1717,13 +1717,13 @@ pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
}
if (!ok) {
device_printf(dev, "%s%srequested unsupported I/O "
"range 0x%lx-0x%lx (decoding 0x%x-0x%x)\n",
"range 0x%jx-0x%jx (decoding 0x%x-0x%x)\n",
name, suffix, start, end, sc->iobase, sc->iolimit);
return (NULL);
}
if (bootverbose)
device_printf(dev,
"%s%srequested I/O range 0x%lx-0x%lx: in range\n",
"%s%srequested I/O range 0x%jx-0x%jx: in range\n",
name, suffix, start, end);
break;
@ -1778,7 +1778,7 @@ pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
#endif
}
if (end < start) {
device_printf(dev, "memory: end (%lx) < start (%lx)\n",
device_printf(dev, "memory: end (%jx) < start (%jx)\n",
end, start);
start = 0;
end = 0;
@ -1786,7 +1786,7 @@ pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
}
if (!ok && bootverbose)
device_printf(dev,
"%s%srequested unsupported memory range %#lx-%#lx "
"%s%srequested unsupported memory range %#jx-%#jx "
"(decoding %#jx-%#jx, %#jx-%#jx)\n",
name, suffix, start, end,
(uintmax_t)sc->membase, (uintmax_t)sc->memlimit,
@ -1795,7 +1795,7 @@ pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
return (NULL);
if (bootverbose)
device_printf(dev,"%s%srequested memory range "
"0x%lx-0x%lx: good\n",
"0x%jx-0x%jx: good\n",
name, suffix, start, end);
break;

View File

@ -185,7 +185,7 @@ pcib_host_res_decodes(struct pcib_host_resources *hr, int type, rman_res_t start
int rid;
if (bootverbose)
device_printf(hr->hr_pcib, "decoding %d %srange %#lx-%#lx\n",
device_printf(hr->hr_pcib, "decoding %d %srange %#jx-%#jx\n",
type, flags & RF_PREFETCHABLE ? "prefetchable ": "", start,
end);
rid = resource_list_add_next(&hr->hr_rl, type, start, end,
@ -229,8 +229,8 @@ pcib_host_res_alloc(struct pcib_host_resources *hr, device_t dev, int type,
if (((flags & RF_PREFETCHABLE) != 0) !=
((rle->flags & RLE_PREFETCH) != 0))
continue;
new_start = ulmax(start, rle->start);
new_end = ulmin(end, rle->end);
new_start = ummax(start, rle->start);
new_end = ummin(end, rle->end);
if (new_start > new_end ||
new_start + count - 1 > new_end ||
new_start + count < new_start)
@ -240,7 +240,7 @@ pcib_host_res_alloc(struct pcib_host_resources *hr, device_t dev, int type,
if (r != NULL) {
if (bootverbose)
device_printf(hr->hr_pcib,
"allocated type %d (%#lx-%#lx) for rid %x of %s\n",
"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));
return (r);

View File

@ -1699,7 +1699,7 @@ ppc_probe(device_t dev, int rid)
next_bios_ppc += 1;
if (bootverbose)
device_printf(dev,
"parallel port found at 0x%lx\n", port);
"parallel port found at 0x%jx\n", port);
}
#else
if ((next_bios_ppc < BIOS_MAX_PPC) &&
@ -1707,7 +1707,7 @@ ppc_probe(device_t dev, int rid)
port = *(BIOS_PORTS + next_bios_ppc++);
if (bootverbose)
device_printf(dev,
"parallel port found at 0x%lx\n", port);
"parallel port found at 0x%jx\n", port);
} else {
device_printf(dev, "parallel port not found.\n");
return (ENXIO);

View File

@ -80,7 +80,7 @@ proto_isa_probe(device_t dev)
return (ENODEV);
sb = sbuf_new_auto();
sbuf_printf(sb, "%s:%#lx", proto_isa_prefix, rman_get_start(res));
sbuf_printf(sb, "%s:%#jx", proto_isa_prefix, rman_get_start(res));
sbuf_finish(sb);
device_set_desc_copy(dev, sbuf_data(sb));
sbuf_delete(sb);

View File

@ -624,11 +624,11 @@ ad1816_attach(device_t dev)
goto no;
}
if (ad1816->drq2)
snprintf(status2, SND_STATUSLEN, ":%ld", rman_get_start(ad1816->drq2));
snprintf(status2, SND_STATUSLEN, ":%jd", rman_get_start(ad1816->drq2));
else
status2[0] = '\0';
snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld%s bufsz %u %s",
snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd drq %jd%s bufsz %u %s",
rman_get_start(ad1816->io_base),
rman_get_start(ad1816->irq),
rman_get_start(ad1816->drq1),

View File

@ -867,12 +867,12 @@ ess_attach(device_t dev)
}
if (sc->drq2)
snprintf(buf, SND_STATUSLEN, ":%ld", rman_get_start(sc->drq2));
snprintf(buf, SND_STATUSLEN, ":%jd", rman_get_start(sc->drq2));
else
buf[0] = '\0';
snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld%s bufsz %u %s",
rman_get_start(sc->io_base), rman_get_start(sc->irq),
snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd drq %jd%s bufsz %u %s",
rman_get_start(sc->io_base), rman_get_start(sc->irq),
rman_get_start(sc->drq1), buf, sc->bufsize,
PCM_KLDSTRING(snd_ess));

View File

@ -1326,7 +1326,7 @@ mss_probe(device_t dev)
}
tmp &= 0x3f;
if (!(tmp == 0x04 || tmp == 0x0f || tmp == 0x00 || tmp == 0x05)) {
BVDDB(printf("No MSS signature detected on port 0x%lx (0x%x)\n",
BVDDB(printf("No MSS signature detected on port 0x%jx (0x%x)\n",
rman_get_start(mss->io_base), tmpx));
goto no;
}
@ -1767,7 +1767,7 @@ mss_doattach(device_t dev, struct mss_info *mss)
else
status2[0] = '\0';
snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %d%s bufsz %u",
snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd drq %d%s bufsz %u",
rman_get_start(mss->io_base), rman_get_start(mss->irq), pdma, status2, mss->bufsize);
if (pcm_register(dev, mss, 1, 1)) goto no;

View File

@ -854,11 +854,11 @@ sb16_attach(device_t dev)
}
if (!(pcm_getflags(dev) & SD_F_SIMPLEX))
snprintf(status2, SND_STATUSLEN, ":%ld", rman_get_start(sb->drq2));
snprintf(status2, SND_STATUSLEN, ":%jd", rman_get_start(sb->drq2));
else
status2[0] = '\0';
snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld%s bufsz %u %s",
snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd drq %jd%s bufsz %u %s",
rman_get_start(sb->io_base), rman_get_start(sb->irq),
rman_get_start(sb->drq1), status2, sb->bufsize,
PCM_KLDSTRING(snd_sb16));

View File

@ -749,7 +749,7 @@ sb_attach(device_t dev)
goto no;
}
snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld bufsz %u %s",
snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd drq %jd bufsz %u %s",
rman_get_start(sb->io_base), rman_get_start(sb->irq),
rman_get_start(sb->drq), sb->bufsize, PCM_KLDSTRING(snd_sb8));

View File

@ -848,7 +848,7 @@ als_pci_attach(device_t dev)
pcm_addchan(dev, PCMDIR_PLAY, &alspchan_class, sc);
pcm_addchan(dev, PCMDIR_REC, &alsrchan_class, sc);
snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld %s",
snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s",
rman_get_start(sc->reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_als4000));
pcm_setstatus(dev, status);
return 0;

View File

@ -1097,7 +1097,7 @@ atiixp_chip_post_init(void *arg)
"polling", CTLTYPE_INT | CTLFLAG_RW, sc->dev, sizeof(sc->dev),
sysctl_atiixp_polling, "I", "Enable polling mode");
snprintf(status, SND_STATUSLEN, "at memory 0x%lx irq %ld %s",
snprintf(status, SND_STATUSLEN, "at memory 0x%jx irq %jd %s",
rman_get_start(sc->reg), rman_get_start(sc->irq),
PCM_KLDSTRING(snd_atiixp));

View File

@ -645,7 +645,7 @@ au_pci_attach(device_t dev)
goto bad;
}
snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld %s",
snprintf(status, SND_STATUSLEN, "at %s 0x%jx irq %jd %s",
(type[0] == SYS_RES_IOPORT)? "io" : "memory",
rman_get_start(reg[0]), rman_get_start(irq),PCM_KLDSTRING(snd_aureal));

View File

@ -995,7 +995,7 @@ cmi_attach(device_t dev)
pcm_addchan(dev, PCMDIR_PLAY, &cmichan_class, sc);
pcm_addchan(dev, PCMDIR_REC, &cmichan_class, sc);
snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld %s",
snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s",
rman_get_start(sc->reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_cmi));
pcm_setstatus(dev, status);

View File

@ -849,7 +849,7 @@ cs4281_pci_attach(device_t dev)
pcm_addchan(dev, PCMDIR_PLAY, &cs4281chan_class, sc);
pcm_addchan(dev, PCMDIR_REC, &cs4281chan_class, sc);
snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld %s",
snprintf(status, SND_STATUSLEN, "at %s 0x%jx irq %jd %s",
(sc->regtype == SYS_RES_IOPORT)? "io" : "memory",
rman_get_start(sc->reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_cs4281));
pcm_setstatus(dev, status);

View File

@ -821,7 +821,7 @@ pcmcsa_attach(device_t dev)
return (ENXIO);
}
snprintf(status, SND_STATUSLEN, "at irq %ld %s",
snprintf(status, SND_STATUSLEN, "at irq %jd %s",
rman_get_start(resp->irq),PCM_KLDSTRING(snd_csa));
/* Enable interrupt. */

View File

@ -1010,7 +1010,7 @@ ds_pci_attach(device_t dev)
goto bad;
}
snprintf(status, SND_STATUSLEN, "at memory 0x%lx irq %ld %s",
snprintf(status, SND_STATUSLEN, "at memory 0x%jx irq %jd %s",
rman_get_start(sc->reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_ds1));
if (pcm_register(dev, sc, DS1_CHANS, 2))

View File

@ -2132,7 +2132,7 @@ emu_pci_attach(device_t dev)
goto bad;
}
snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld %s",
snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s",
rman_get_start(sc->reg), rman_get_start(sc->irq),
PCM_KLDSTRING(snd_emu10k1));

View File

@ -3225,7 +3225,7 @@ emu_pci_attach(device_t dev)
device_printf(dev, "unable to create control device\n");
goto bad;
}
snprintf(status, 255, "rev %d at io 0x%lx irq %ld", sc->rev, rman_get_start(sc->reg), rman_get_start(sc->irq));
snprintf(status, 255, "rev %d at io 0x%jx irq %jd", sc->rev, rman_get_start(sc->reg), rman_get_start(sc->irq));
/* Voices */
for (i = 0; i < NUM_G; i++) {

View File

@ -2599,7 +2599,7 @@ envy24_pci_attach(device_t dev)
/* set status iformation */
snprintf(status, SND_STATUSLEN,
"at io 0x%lx:%ld,0x%lx:%ld,0x%lx:%ld,0x%lx:%ld irq %ld",
"at io 0x%jx:%jd,0x%jx:%jd,0x%jx:%jd,0x%jx:%jd irq %jd",
rman_get_start(sc->cs),
rman_get_end(sc->cs) - rman_get_start(sc->cs) + 1,
rman_get_start(sc->ddma),

View File

@ -2507,7 +2507,7 @@ envy24ht_pci_attach(device_t dev)
/* set status iformation */
snprintf(status, SND_STATUSLEN,
"at io 0x%lx:%ld,0x%lx:%ld irq %ld",
"at io 0x%jx:%jd,0x%jx:%jd irq %jd",
rman_get_start(sc->cs),
rman_get_end(sc->cs) - rman_get_start(sc->cs) + 1,
rman_get_start(sc->mt),

View File

@ -1856,7 +1856,7 @@ es_pci_attach(device_t dev)
goto bad;
}
snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld %s",
snprintf(status, SND_STATUSLEN, "at %s 0x%jx irq %jd %s",
(es->regtype == SYS_RES_IOPORT)? "io" : "memory",
rman_get_start(es->reg), rman_get_start(es->irq),
PCM_KLDSTRING(snd_es137x));

View File

@ -639,7 +639,7 @@ fm801_pci_attach(device_t dev)
goto oops;
}
snprintf(status, 64, "at %s 0x%lx irq %ld %s",
snprintf(status, 64, "at %s 0x%jx irq %jd %s",
(fm801->regtype == SYS_RES_IOPORT)? "io" : "memory",
rman_get_start(fm801->reg), rman_get_start(fm801->irq),PCM_KLDSTRING(snd_fm801));

View File

@ -668,7 +668,7 @@ hdspe_pcm_attach(device_t dev)
scp->chnum++;
}
snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld %s",
snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s",
rman_get_start(scp->sc->cs),
rman_get_start(scp->sc->irq),
PCM_KLDSTRING(snd_hdspe));

View File

@ -687,7 +687,7 @@ ich_setstatus(struct sc_info *sc)
char status[SND_STATUSLEN];
snprintf(status, SND_STATUSLEN,
"at io 0x%lx, 0x%lx irq %ld bufsz %u %s",
"at io 0x%jx, 0x%jx irq %jd bufsz %u %s",
rman_get_start(sc->nambar), rman_get_start(sc->nabmbar),
rman_get_start(sc->irq), sc->bufsz,PCM_KLDSTRING(snd_ich));

View File

@ -1917,7 +1917,7 @@ agg_attach(device_t dev)
adjust_pchbase(ess->pch, ess->playchns, ess->bufsz);
snprintf(status, SND_STATUSLEN,
"port 0x%lx-0x%lx irq %ld at device %d.%d on pci%d",
"port 0x%jx-0x%jx irq %jd at device %d.%d on pci%d",
rman_get_start(reg), rman_get_end(reg), rman_get_start(irq),
pci_get_slot(dev), pci_get_function(dev), pci_get_bus(dev));
pcm_setstatus(dev, status);

View File

@ -1440,7 +1440,7 @@ m3_pci_attach(device_t dev)
goto bad;
}
}
snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld %s",
snprintf(status, SND_STATUSLEN, "at %s 0x%jx irq %jd %s",
(sc->regtype == SYS_RES_IOPORT)? "io" : "memory",
rman_get_start(sc->reg), rman_get_start(sc->irq),
PCM_KLDSTRING(snd_maestro3));

View File

@ -702,7 +702,7 @@ nm_pci_attach(device_t dev)
goto bad;
}
snprintf(status, SND_STATUSLEN, "at memory 0x%lx, 0x%lx irq %ld %s",
snprintf(status, SND_STATUSLEN, "at memory 0x%jx, 0x%jx irq %jd %s",
rman_get_start(sc->buf), rman_get_start(sc->reg),
rman_get_start(sc->irq),PCM_KLDSTRING(snd_neomagic));

View File

@ -1051,7 +1051,7 @@ ess_attach(device_t dev)
if (mixer_init(dev, &solomixer_class, sc))
goto no;
snprintf(status, SND_STATUSLEN, "at io 0x%lx,0x%lx,0x%lx irq %ld %s",
snprintf(status, SND_STATUSLEN, "at io 0x%jx,0x%jx,0x%jx irq %jd %s",
rman_get_start(sc->io), rman_get_start(sc->sb), rman_get_start(sc->vc),
rman_get_start(sc->irq),PCM_KLDSTRING(snd_solo));

View File

@ -948,7 +948,7 @@ tr_pci_attach(device_t dev)
goto bad;
}
snprintf(status, 64, "at io 0x%lx irq %ld %s",
snprintf(status, 64, "at io 0x%jx irq %jd %s",
rman_get_start(tr->reg), rman_get_start(tr->irq),PCM_KLDSTRING(snd_t4dwave));
if (pcm_register(dev, tr, dacn, 1))

View File

@ -1348,7 +1348,7 @@ via_attach(device_t dev)
ac97_setextmode(via->codec, ext);
}
snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld %s",
snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s",
rman_get_start(via->reg), rman_get_start(via->irq),
PCM_KLDSTRING(snd_via8233));

View File

@ -590,7 +590,7 @@ via_attach(device_t dev)
NSEGS * sizeof(struct via_dma_op), dma_cb, via, 0) != 0)
goto bad;
snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld %s",
snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s",
rman_get_start(via->reg), rman_get_start(via->irq),
PCM_KLDSTRING(snd_via82c686));

View File

@ -815,7 +815,7 @@ sv_attach(device_t dev) {
((mu - ml) % 0x200)) {
device_printf(dev, "sv_attach: resource assumptions not met "
"(midi 0x%08lx, games 0x%08lx)\n",
midi_start, games_start);
(u_long)midi_start, (u_long)games_start);
goto fail;
}
@ -874,7 +874,7 @@ sv_attach(device_t dev) {
pcm_addchan(dev, PCMDIR_PLAY, &svpchan_class, sc);
pcm_addchan(dev, PCMDIR_REC, &svrchan_class, sc);
snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld %s",
snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s",
rman_get_start(sc->enh_reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_vibes));
pcm_setstatus(dev, status);

View File

@ -495,7 +495,7 @@ wlattach(device_t device)
}
#ifdef WLDEBUG
printf("wlattach: base %lx, unit %d\n", rman_get_start(sc->res_ioport),
printf("wlattach: base %jx, unit %d\n", rman_get_start(sc->res_ioport),
device_get_unit(device));
#endif

View File

@ -1984,7 +1984,7 @@ xe_activate(device_t dev)
sc->port_res);
start = (rman_get_start(sc->port_res) + 15) & ~0xf;
} while (1);
DEVPRINTF(1, (dev, "RealPort port 0x%0lx, size 0x%0lx\n",
DEVPRINTF(1, (dev, "RealPort port 0x%0jx, size 0x%0jx\n",
bus_get_resource_start(dev, SYS_RES_IOPORT, sc->port_rid),
bus_get_resource_count(dev, SYS_RES_IOPORT, sc->port_rid)));
} else if (sc->ce2) {
@ -2024,7 +2024,7 @@ xe_activate(device_t dev)
sc->port_res);
sc->port_res = NULL;
}
DEVPRINTF(1, (dev, "CEM2/CEM3 port 0x%0lx, size 0x%0lx\n",
DEVPRINTF(1, (dev, "CEM2/CEM3 port 0x%0jx, size 0x%0jx\n",
bus_get_resource_start(dev, SYS_RES_IOPORT, sc->port_rid),
bus_get_resource_count(dev, SYS_RES_IOPORT, sc->port_rid)));
}

View File

@ -140,7 +140,7 @@ xe_cemfix(device_t dev)
DEVPRINTF(2, (dev, "cemfix\n"));
DEVPRINTF(1, (dev, "CEM I/O port 0x%0lx, size 0x%0lx\n",
DEVPRINTF(1, (dev, "CEM I/O port 0x%0jx, size 0x%0jx\n",
bus_get_resource_start(dev, SYS_RES_IOPORT, sc->port_rid),
bus_get_resource_count(dev, SYS_RES_IOPORT, sc->port_rid)));

View File

@ -159,7 +159,7 @@ rman_manage_region(struct rman *rm, rman_res_t start, rman_res_t end)
struct resource_i *r, *s, *t;
int rv = 0;
DPRINTF(("rman_manage_region: <%s> request: start %#lx, end %#lx\n",
DPRINTF(("rman_manage_region: <%s> request: start %#jx, end %#jx\n",
rm->rm_descr, start, end));
if (start < rm->rm_start || end > rm->rm_end)
return EINVAL;
@ -174,7 +174,7 @@ rman_manage_region(struct rman *rm, rman_res_t start, rman_res_t end)
/* Skip entries before us. */
TAILQ_FOREACH(s, &rm->rm_list, r_link) {
if (s->r_end == ULONG_MAX)
if (s->r_end == ~0)
break;
if (s->r_end + 1 >= r->r_start)
break;
@ -444,8 +444,8 @@ rman_reserve_resource_bound(struct rman *rm, rman_res_t start, rman_res_t end,
rv = NULL;
DPRINTF(("rman_reserve_resource_bound: <%s> request: [%#lx, %#lx], "
"length %#lx, flags %u, device %s\n", rm->rm_descr, start, end,
DPRINTF(("rman_reserve_resource_bound: <%s> request: [%#jx, %#jx], "
"length %#jx, flags %x, device %s\n", rm->rm_descr, start, end,
count, flags,
dev == NULL ? "<null>" : device_get_nameunit(dev)));
KASSERT((flags & RF_FIRSTSHARE) == 0,
@ -454,19 +454,29 @@ rman_reserve_resource_bound(struct rman *rm, rman_res_t start, rman_res_t end,
mtx_lock(rm->rm_mtx);
r = TAILQ_FIRST(&rm->rm_list);
if (r == NULL) {
DPRINTF(("NULL list head\n"));
} else {
DPRINTF(("rman_reserve_resource_bound: trying %#jx <%#jx,%#jx>\n",
r->r_end, start, count-1));
}
for (r = TAILQ_FIRST(&rm->rm_list);
r && r->r_end < start + count - 1;
r = TAILQ_NEXT(r, r_link))
r = TAILQ_NEXT(r, r_link)) {
;
DPRINTF(("rman_reserve_resource_bound: tried %#jx <%#jx,%#jx>\n",
r->r_end, start, count-1));
}
if (r == NULL) {
DPRINTF(("could not find a region\n"));
goto out;
}
amask = (1ul << RF_ALIGNMENT(flags)) - 1;
KASSERT(start <= ULONG_MAX - amask,
("start (%#lx) + amask (%#lx) would wrap around", start, amask));
amask = (1ull << RF_ALIGNMENT(flags)) - 1;
KASSERT(start <= RM_MAX_END - amask,
("start (%#jx) + amask (%#jx) would wrap around", start, amask));
/* If bound is 0, bmask will also be 0 */
bmask = ~(bound - 1);
@ -474,18 +484,18 @@ rman_reserve_resource_bound(struct rman *rm, rman_res_t start, rman_res_t end,
* First try to find an acceptable totally-unshared region.
*/
for (s = r; s; s = TAILQ_NEXT(s, r_link)) {
DPRINTF(("considering [%#lx, %#lx]\n", s->r_start, s->r_end));
DPRINTF(("considering [%#jx, %#jx]\n", s->r_start, s->r_end));
/*
* The resource list is sorted, so there is no point in
* searching further once r_start is too large.
*/
if (s->r_start > end - (count - 1)) {
DPRINTF(("s->r_start (%#lx) + count - 1> end (%#lx)\n",
DPRINTF(("s->r_start (%#jx) + count - 1> end (%#jx)\n",
s->r_start, end));
break;
}
if (s->r_start > ULONG_MAX - amask) {
DPRINTF(("s->r_start (%#lx) + amask (%#lx) too large\n",
if (s->r_start > RM_MAX_END - amask) {
DPRINTF(("s->r_start (%#jx) + amask (%#jx) too large\n",
s->r_start, amask));
break;
}
@ -493,7 +503,7 @@ rman_reserve_resource_bound(struct rman *rm, rman_res_t start, rman_res_t end,
DPRINTF(("region is allocated\n"));
continue;
}
rstart = ulmax(s->r_start, start);
rstart = ummax(s->r_start, start);
/*
* Try to find a region by adjusting to boundary and alignment
* until both conditions are satisfied. This is not an optimal
@ -505,16 +515,16 @@ rman_reserve_resource_bound(struct rman *rm, rman_res_t start, rman_res_t end,
rstart += bound - (rstart & ~bmask);
} while ((rstart & amask) != 0 && rstart < end &&
rstart < s->r_end);
rend = ulmin(s->r_end, ulmax(rstart + count - 1, end));
rend = ummin(s->r_end, ummax(rstart + count - 1, end));
if (rstart > rend) {
DPRINTF(("adjusted start exceeds end\n"));
continue;
}
DPRINTF(("truncated region: [%#lx, %#lx]; size %#lx (requested %#lx)\n",
DPRINTF(("truncated region: [%#jx, %#jx]; size %#jx (requested %#jx)\n",
rstart, rend, (rend - rstart + 1), count));
if ((rend - rstart + 1) >= count) {
DPRINTF(("candidate region: [%#lx, %#lx], size %#lx\n",
DPRINTF(("candidate region: [%#jx, %#jx], size %#jx\n",
rstart, rend, (rend - rstart + 1)));
if ((s->r_end - s->r_start + 1) == count) {
DPRINTF(("candidate region is entire chunk\n"));
@ -545,7 +555,7 @@ rman_reserve_resource_bound(struct rman *rm, rman_res_t start, rman_res_t end,
if (s->r_start < rv->r_start && s->r_end > rv->r_end) {
DPRINTF(("splitting region in three parts: "
"[%#lx, %#lx]; [%#lx, %#lx]; [%#lx, %#lx]\n",
"[%#jx, %#jx]; [%#jx, %#jx]; [%#jx, %#jx]\n",
s->r_start, rv->r_start - 1,
rv->r_start, rv->r_end,
rv->r_end + 1, s->r_end));
@ -1032,8 +1042,8 @@ dump_rman_header(struct rman *rm)
if (db_pager_quit)
return;
db_printf("rman %p: %s (0x%lx-0x%lx full range)\n",
rm, rm->rm_descr, rm->rm_start, rm->rm_end);
db_printf("rman %p: %s (0x%jx-0x%jx full range)\n",
rm, rm->rm_descr, (rman_res_t)rm->rm_start, (rman_res_t)rm->rm_end);
}
static void
@ -1051,7 +1061,7 @@ dump_rman(struct rman *rm)
devname = "nomatch";
} else
devname = NULL;
db_printf(" 0x%lx-0x%lx (RID=%d) ",
db_printf(" 0x%jx-0x%jx (RID=%d) ",
r->r_start, r->r_end, r->r_rid);
if (devname != NULL)
db_printf("(%s)\n", devname);

View File

@ -178,7 +178,7 @@ apb_alloc_resource(device_t bus, device_t child, int type, int *rid,
passthrough = (device_get_parent(child) != bus);
rle = NULL;
dprintf("%s: entry (%p, %p, %d, %d, %p, %p, %ld, %d)\n",
dprintf("%s: entry (%p, %p, %d, %d, %p, %p, %jd, %d)\n",
__func__, bus, child, type, *rid, (void *)(intptr_t)start,
(void *)(intptr_t)end, count, flags);

View File

@ -275,7 +275,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
struct rman *rm;
int isdefault, needactivate, passthrough;
dprintf("%s: entry (%p, %p, %d, %p, %p, %p, %ld, %d)\n",
dprintf("%s: entry (%p, %p, %d, %p, %p, %p, %jd, %d)\n",
__func__, bus, child, type, rid, (void *)(intptr_t)start,
(void *)(intptr_t)end, count, flags);
dprintf("%s: requested rid is %d\n", __func__, *rid);
@ -350,7 +350,7 @@ nexus_set_resource(device_t dev, device_t child, int type, int rid,
struct resource_list *rl = &ndev->nx_resources;
struct resource_list_entry *rle;
dprintf("%s: entry (%p, %p, %d, %d, %p, %ld)\n",
dprintf("%s: entry (%p, %p, %d, %d, %p, %jd)\n",
__func__, dev, child, type, rid, (void *)(intptr_t)start, count);
rle = resource_list_add(rl, type, rid, start, start + count - 1,

View File

@ -433,7 +433,7 @@ mips_platform_pcib_setup_intr(device_t dev, device_t child,
if (error)
return error;
if (rman_get_start(irq) != rman_get_end(irq)) {
device_printf(dev, "Interrupt allocation %lu != %lu\n",
device_printf(dev, "Interrupt allocation %ju != %ju\n",
rman_get_start(irq), rman_get_end(irq));
return (EINVAL);
}

View File

@ -209,7 +209,7 @@ xlp_simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid,
if (j == sc->nranges && sc->nranges != 0) {
if (bootverbose)
device_printf(bus, "Could not map resource "
"%#lx-%#lx\n", start, end);
"%#jx-%#jx\n", start, end);
return (NULL);
}
}
@ -235,7 +235,7 @@ xlp_simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid,
} else {
if (bootverbose)
device_printf(bus, "Invalid MEM range"
"%#lx-%#lx\n", start, end);
"%#jx-%#jx\n", start, end);
return (NULL);
}
break;

View File

@ -134,17 +134,17 @@ iodi_alloc_resource(device_t bus, device_t child, int type, int *rid,
#ifdef DEBUG
switch (type) {
case SYS_RES_IRQ:
device_printf(bus, "IRQ resource - for %s %lx-%lx\n",
device_printf(bus, "IRQ resource - for %s %jx-%jx\n",
device_get_nameunit(child), start, end);
break;
case SYS_RES_IOPORT:
device_printf(bus, "IOPORT resource - for %s %lx-%lx\n",
device_printf(bus, "IOPORT resource - for %s %jx-%jx\n",
device_get_nameunit(child), start, end);
break;
case SYS_RES_MEMORY:
device_printf(bus, "MEMORY resource - for %s %lx-%lx\n",
device_printf(bus, "MEMORY resource - for %s %jx-%jx\n",
device_get_nameunit(child), start, end);
break;
}

View File

@ -464,7 +464,7 @@ mips_platform_pci_setup_intr(device_t dev, device_t child,
if (error)
return error;
if (rman_get_start(irq) != rman_get_end(irq)) {
device_printf(dev, "Interrupt allocation %lu != %lu\n",
device_printf(dev, "Interrupt allocation %ju != %ju\n",
rman_get_start(irq), rman_get_end(irq));
return (EINVAL);
}

View File

@ -718,8 +718,8 @@ lbc_alloc_resource(device_t bus, device_t child, int type, int *rid,
res = rman_reserve_resource(rm, start, end, count, flags, child);
if (res == NULL) {
device_printf(bus, "failed to reserve resource %#lx - %#lx "
"(%#lx)\n", start, end, count);
device_printf(bus, "failed to reserve resource %#jx - %#jx "
"(%#jx)\n", start, end, count);
return (NULL);
}
@ -749,8 +749,8 @@ lbc_print_child(device_t dev, device_t child)
rv = 0;
rv += bus_print_child_header(dev, child);
rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx");
rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld");
rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx");
rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd");
rv += bus_print_child_footer(dev, child);
return (rv);

View File

@ -384,10 +384,10 @@ ofw_pci_activate_resource(device_t bus, device_t child, int type, int rid,
}
if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) {
struct ofw_pci_range *rp;
vm_offset_t start;
vm_paddr_t start;
int space;
start = (vm_offset_t)rman_get_start(res);
start = (vm_paddr_t)rman_get_start(res);
/*
* Map this through the ranges list
@ -416,8 +416,8 @@ ofw_pci_activate_resource(device_t bus, device_t child, int type, int rid,
}
if (bootverbose)
printf("ofw_pci mapdev: start %zx, len %ld\n", start,
rman_get_size(res));
printf("ofw_pci mapdev: start %jx, len %jd\n",
(rman_res_t)start, rman_get_size(res));
p = pmap_mapdev(start, (vm_size_t)rman_get_size(res));
if (p == NULL)

View File

@ -591,7 +591,7 @@ unin_chip_activate_resource(device_t bus, device_t child, int type, int rid,
start = (vm_offset_t) rman_get_start(res);
if (bootverbose)
printf("unin mapdev: start %zx, len %ld\n", start,
printf("unin mapdev: start %zx, len %jd\n", start,
rman_get_size(res));
p = pmap_mapdev(start, (vm_size_t) rman_get_size(res));

View File

@ -203,7 +203,7 @@ nexus_activate_resource(device_t bus __unused, device_t child __unused,
start = (vm_paddr_t) rman_get_start(r);
if (bootverbose)
printf("nexus mapdev: start %jx, len %ld\n",
printf("nexus mapdev: start %jx, len %jd\n",
(uintmax_t)start, rman_get_size(r));
p = pmap_mapdev(start, (vm_size_t) rman_get_size(r));

View File

@ -136,7 +136,7 @@ apb_map_print(uint8_t map, rman_res_t scale)
for (first = 1, i = 0; i < 8; i++) {
if ((map & (1 << i)) != 0) {
printf("%s0x%lx-0x%lx", first ? "" : ", ",
printf("%s0x%jx-0x%jx", first ? "" : ", ",
i * scale, (i + 1) * scale - 1);
first = 0;
}
@ -253,26 +253,26 @@ apb_alloc_resource(device_t dev, device_t child, int type, int *rid,
case SYS_RES_IOPORT:
if (!apb_checkrange(sc->sc_iomap, APB_IO_SCALE, start, end)) {
device_printf(dev, "device %s requested unsupported "
"I/O range 0x%lx-0x%lx\n",
"I/O range 0x%jx-0x%jx\n",
device_get_nameunit(child), start, end);
return (NULL);
}
if (bootverbose)
device_printf(sc->sc_bsc.ops_pcib_sc.dev, "device "
"%s requested decoded I/O range 0x%lx-0x%lx\n",
"%s requested decoded I/O range 0x%jx-0x%jx\n",
device_get_nameunit(child), start, end);
break;
case SYS_RES_MEMORY:
if (!apb_checkrange(sc->sc_memmap, APB_MEM_SCALE, start,
end)) {
device_printf(dev, "device %s requested unsupported "
"memory range 0x%lx-0x%lx\n",
"memory range 0x%jx-0x%jx\n",
device_get_nameunit(child), start, end);
return (NULL);
}
if (bootverbose)
device_printf(sc->sc_bsc.ops_pcib_sc.dev, "device "
"%s requested decoded memory range 0x%lx-0x%lx\n",
"%s requested decoded memory range 0x%jx-0x%jx\n",
device_get_nameunit(child), start, end);
break;
}

View File

@ -112,6 +112,6 @@ typedef union {
__int64_t _mbstateL; /* for alignment */
} __mbstate_t;
typedef unsigned long __rman_res_t;
typedef __uintmax_t __rman_res_t;
#endif /* !_SYS__TYPES_H_ */

View File

@ -58,7 +58,7 @@
* in the range 5 to 9.
*/
#undef __FreeBSD_version
#define __FreeBSD_version 1100102 /* Master, propagated to newvers */
#define __FreeBSD_version 1100103 /* Master, propagated to newvers */
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

View File

@ -987,14 +987,6 @@ apic_add_resource(device_t dev, int rid, vm_paddr_t base, size_t length)
{
int error;
#ifdef PAE
/*
* Resources use long's to track resources, so we can't
* include memory regions above 4GB.
*/
if (base >= ~0ul)
return;
#endif
error = bus_set_resource(dev, SYS_RES_MEMORY, rid, base, length);
if (error)
panic("apic_add_resource: resource %d failed set with %d", rid,

View File

@ -66,9 +66,9 @@ print_resource(struct devinfo_res *res)
rman = devinfo_handle_to_rman(res->dr_rman);
hexmode = (rman->dm_size > 1000) || (rman->dm_size == 0);
printf(hexmode ? "0x%lx" : "%lu", res->dr_start);
printf(hexmode ? "0x%jx" : "%ju", res->dr_start);
if (res->dr_size > 1)
printf(hexmode ? "-0x%lx" : "-%lu",
printf(hexmode ? "-0x%jx" : "-%ju",
res->dr_start + res->dr_size - 1);
}