#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/rman.h>
+#include <sys/machintr.h>
#include <machine/vmparam.h>
#include <vm/vm.h>
portsize = dvp->id_driver->probe(dvp);
isa_compat_release_resources(dev, &res);
if (portsize != 0) {
- if (portsize > 0 || dvp->id_iobase != old.id_iobase)
- bus_set_resource(dev, SYS_RES_IOPORT,
- 0, dvp->id_iobase, portsize);
- if (dvp->id_irq != old.id_irq)
- bus_set_resource(dev, SYS_RES_IRQ, 0,
- ffs(dvp->id_irq) - 1, 1);
- if (dvp->id_drq != old.id_drq)
+ if (portsize > 0 || dvp->id_iobase != old.id_iobase) {
+ bus_set_resource(dev, SYS_RES_IOPORT, 0,
+ dvp->id_iobase, portsize, -1);
+ }
+ if (dvp->id_irq != old.id_irq) {
+ int intr = ffs(dvp->id_irq) - 1;
+
+ bus_set_resource(dev, SYS_RES_IRQ, 0, intr, 1,
+ machintr_intr_cpuid(intr));
+ }
+ if (dvp->id_drq != old.id_drq) {
bus_set_resource(dev, SYS_RES_DRQ, 0,
- dvp->id_drq, 1);
+ dvp->id_drq, 1, -1);
+ }
if (dvp->id_maddr != old.id_maddr
|| dvp->id_msize != old.id_msize) {
maddr = dvp->id_maddr;
- if (maddr != NULL)
- bus_set_resource(dev,
- SYS_RES_MEMORY,
- 0,
- kvtop(maddr),
- dvp->id_msize);
- else
+ if (maddr != NULL) {
+ bus_set_resource(dev, SYS_RES_MEMORY, 0,
+ kvtop(maddr), dvp->id_msize, -1);
+ } else {
bus_delete_resource(dev,
- SYS_RES_MEMORY,
- 0);
+ SYS_RES_MEMORY, 0);
+ }
}
return 0;
}
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/rman.h>
+#include <sys/machintr.h>
#include "isavar.h"
#include "isa_common.h"
start + size - 1 <= end;
start += MAX(align, 1)) {
bus_set_resource(child, SYS_RES_MEMORY, i,
- start, size);
+ start, size, -1);
res[i] = bus_alloc_resource(child,
SYS_RES_MEMORY, &i,
0, ~0, 1, 0 /* !RF_ACTIVE */);
start + size - 1 <= end;
start += align) {
bus_set_resource(child, SYS_RES_IOPORT, i,
- start, size);
+ start, size, -1);
res[i] = bus_alloc_resource(child,
SYS_RES_IOPORT, &i,
0, ~0, 1, 0 /* !RF_ACTIVE */);
irq != -1;
irq = find_next_bit(mask, irq)) {
bus_set_resource(child, SYS_RES_IRQ, i,
- irq, 1);
+ irq, 1, machintr_intr_cpuid(irq));
res[i] = bus_alloc_resource(child,
SYS_RES_IRQ, &i,
0, ~0, 1, 0 /* !RF_ACTIVE */ );
drq != -1;
drq = find_next_bit(mask, drq)) {
bus_set_resource(child, SYS_RES_DRQ, i,
- drq, 1);
+ drq, 1, -1);
res[i] = bus_alloc_resource(child,
SYS_RES_DRQ, &i,
0, ~0, 1, 0 /* !RF_ACTIVE */);
static int
isa_set_resource(device_t dev, device_t child, int type, int rid,
- u_long start, u_long count)
+ u_long start, u_long count, int cpuid)
{
struct isa_device* idev = DEVTOISA(child);
struct resource_list *rl = &idev->id_resources;
if (type == SYS_RES_DRQ && rid >= ISA_NDRQ)
return EINVAL;
- resource_list_add(rl, type, rid, start, start + count - 1, count, -1);
+ resource_list_add(rl, type, rid, start, start + count - 1, count,
+ cpuid);
return 0;
}
#include <sys/kernel.h>
#include <sys/bus.h>
#include <sys/module.h>
+#include <sys/machintr.h>
#include "isavar.h"
resource_int_value(name, unit, "port", &start);
resource_int_value(name, unit, "portsize", &count);
if (start > 0 || count > 0)
- bus_set_resource(child, SYS_RES_IOPORT, 0, start, count);
+ bus_set_resource(child, SYS_RES_IOPORT, 0, start, count, -1);
start = 0;
count = 0;
resource_int_value(name, unit, "maddr", &start);
resource_int_value(name, unit, "msize", &count);
if (start > 0 || count > 0)
- bus_set_resource(child, SYS_RES_MEMORY, 0, start, count);
+ bus_set_resource(child, SYS_RES_MEMORY, 0, start, count, -1);
- if (resource_int_value(name, unit, "irq", &start) == 0 && start > 0)
- bus_set_resource(child, SYS_RES_IRQ, 0, start, 1);
+ if (resource_int_value(name, unit, "irq", &start) == 0 && start > 0) {
+ bus_set_resource(child, SYS_RES_IRQ, 0, start, 1,
+ machintr_intr_cpuid(start));
+ }
if (resource_int_value(name, unit, "drq", &start) == 0 && start >= 0)
- bus_set_resource(child, SYS_RES_DRQ, 0, start, 1);
+ bus_set_resource(child, SYS_RES_DRQ, 0, start, 1, -1);
if (resource_int_value(name, unit, "flags", &t) == 0)
device_set_flags(child, t);
error = vga_probe_unit(device_get_unit(dev), &adp, device_get_flags(dev));
if (error == 0) {
bus_set_resource(dev, SYS_RES_IOPORT, 0,
- adp.va_io_base, adp.va_io_size);
+ adp.va_io_base, adp.va_io_size, -1);
bus_set_resource(dev, SYS_RES_MEMORY, 0,
- adp.va_mem_base, adp.va_mem_size);
+ adp.va_mem_base, adp.va_mem_size, -1);
#if 0
isa_set_port(dev, adp.va_io_base);
isa_set_portsize(dev, adp.va_io_size);
const char *name, int type, int count, const char *format);
static int pccard_print_child(device_t dev, device_t child);
static int pccard_set_resource(device_t dev, device_t child, int type,
- int rid, u_long start, u_long count);
+ int rid, u_long start, u_long count, int cpuid);
static int pccard_get_resource(device_t dev, device_t child, int type,
int rid, u_long *startp, u_long *countp);
static void pccard_delete_resource(device_t dev, device_t child, int type,
static int
pccard_set_resource(device_t dev, device_t child, int type, int rid,
- u_long start, u_long count)
+ u_long start, u_long count, int cpuid)
{
struct pccard_ivar *devi = PCCARD_IVAR(child);
struct resource_list *rl = &devi->resources;
if (type == SYS_RES_DRQ && rid >= PCCARD_NDRQ)
return (EINVAL);
- resource_list_add(rl, type, rid, start, start + count - 1, count, -1);
+ resource_list_add(rl, type, rid, start, start + count - 1, count,
+ cpuid);
if (NULL != resource_list_alloc(rl, device_get_parent(dev), dev,
type, &rid, start, start + count - 1, count, 0, -1))
return 0;
#include <sys/bus.h>
#include <sys/rman.h>
#include <sys/thread2.h>
+#include <sys/machintr.h>
#include "acpi.h"
#include "accommon.h"
/* Set up the interrupt resource. */
sc->acpi_irq_rid = 0;
- bus_set_resource(sc->acpi_dev, SYS_RES_IRQ, 0, InterruptNumber, 1);
+ bus_set_resource(sc->acpi_dev, SYS_RES_IRQ, 0, InterruptNumber, 1,
+ machintr_intr_cpuid(InterruptNumber));
sc->acpi_irq = bus_alloc_resource_any(sc->acpi_dev, SYS_RES_IRQ,
&sc->acpi_irq_rid, flags);
if (sc->acpi_irq == NULL) {
return (EINVAL);
bus_set_resource(dev, res_type, *rid, gas->Address,
- gas->BitWidth / 8);
+ gas->BitWidth / 8, -1);
*res = bus_alloc_resource_any(dev, res_type, rid, RF_ACTIVE | flags);
if (*res != NULL) {
*type = res_type;
/* Set the data and CSR register addresses. */
bus_set_resource(child, SYS_RES_IOPORT, 0, ecdt->Data.Address,
- /*count*/1);
+ /*count*/1, -1);
bus_set_resource(child, SYS_RES_IOPORT, 1, ecdt->Control.Address,
- /*count*/1);
+ /*count*/1, -1);
/*
* Store values for the probe/attach routines to use. Store the
acpi_hpet_res_start = hpet->Address.Address;
if (bus_set_resource(child, SYS_RES_MEMORY, 0,
- hpet->Address.Address, HPET_MEM_WIDTH)) {
+ hpet->Address.Address, HPET_MEM_WIDTH, -1)) {
device_printf(child, "could not set iomem resources: "
"0x%jx, %d\n", (uintmax_t)hpet->Address.Address,
HPET_MEM_WIDTH);
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/resource.h>
+#include <sys/machintr.h>
#include <sys/rman.h>
if (cp == NULL)
return;
- bus_set_resource(dev, SYS_RES_IOPORT, cp->ar_nio++, base, length);
+ bus_set_resource(dev, SYS_RES_IOPORT, cp->ar_nio++, base, length, -1);
}
static void
if (cp == NULL)
return;
- bus_set_resource(dev, SYS_RES_MEMORY, cp->ar_nmem++, base, length);
+ bus_set_resource(dev, SYS_RES_MEMORY, cp->ar_nmem++, base, length, -1);
}
static void
if (count != 1)
return;
- bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, *irq, 1);
+ bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, *irq, 1,
+ machintr_intr_cpuid(*irq));
}
static void
if (count != 1)
return;
- bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, *irq, 1);
+ bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, *irq, 1,
+ machintr_intr_cpuid(*irq));
}
static void
if (count != 1)
return;
- bus_set_resource(dev, SYS_RES_DRQ, cp->ar_ndrq++, *drq, 1);
+ bus_set_resource(dev, SYS_RES_DRQ, cp->ar_ndrq++, *drq, 1, -1);
}
static void
} else bus_rle = NULL;
/* If we didn't merge with anything, add this resource. */
if (bus_rle == NULL) {
- bus_set_resource(bus, type, acpi_sysres_rid++, start, count);
+ bus_set_resource(bus, type, acpi_sysres_rid++, start, count, -1);
}
}
SYS_RES_IOPORT : SYS_RES_MEMORY;
rlen = AcpiGbl_FADT.PmTimerLength;
rstart = AcpiGbl_FADT.XPmTimerBlock.Address;
- if (bus_set_resource(dev, rtype, rid, rstart, rlen)) {
+ if (bus_set_resource(dev, rtype, rid, rstart, rlen, -1)) {
device_printf(dev, "couldn't set resource (%s 0x%lx+0x%lx)\n",
(rtype == SYS_RES_IOPORT) ? "port" : "mem", rstart, rlen);
return (ENXIO);
#include <sys/kernel.h>
#include <sys/bus.h>
#include <sys/rman.h>
+#include <sys/machintr.h>
#include <bus/isa/isavar.h>
/* Already been attached */
continue;
- if (bus_set_resource(dev, SYS_RES_IOPORT, 0, port_addr, 1))
+ if (bus_set_resource(dev, SYS_RES_IOPORT, 0, port_addr, 1, -1))
continue;
/* XXX what is the real portsize? */
adv->isa_dma_speed = ADV_DEF_ISA_DMA_SPEED;
adv->isa_dma_channel = adv_get_isa_dma_channel(adv);
bus_set_resource(dev, SYS_RES_DRQ, 0,
- adv->isa_dma_channel, 1);
+ adv->isa_dma_channel, 1, -1);
} else {
panic("advisaprobe: Unknown card revision\n");
}
}
/* Determine our IRQ */
- if (bus_get_resource(dev, SYS_RES_IRQ, 0, &irq, NULL))
- bus_set_resource(dev, SYS_RES_IRQ, 0,
- adv_get_chip_irq(adv), 1);
- else
+ if (bus_get_resource(dev, SYS_RES_IRQ, 0, &irq, NULL)) {
+ int chip_irq = adv_get_chip_irq(adv);
+
+ bus_set_resource(dev, SYS_RES_IRQ, 0, chip_irq, 1,
+ machintr_intr_cpuid(chip_irq));
+ } else {
adv_set_chip_irq(adv, irq);
+ }
irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
RF_ACTIVE);
}
if (user_iobase)
- bus_set_resource(dev, SYS_RES_IOPORT, 0, iobase, iocount);
+ bus_set_resource(dev, SYS_RES_IOPORT, 0, iobase, iocount, -1);
else
bus_delete_resource(dev, SYS_RES_IOPORT, 0);
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/rman.h>
+#include <sys/machintr.h>
#include <bus/isa/isavar.h>
#include "aic6360reg.h"
for (i = 0; i < numports; i++) {
if (bus_set_resource(dev, SYS_RES_IOPORT, 0, ports[i],
- AIC_ISA_PORTSIZE))
+ AIC_ISA_PORTSIZE, -1))
continue;
if (aic_isa_alloc_resources(dev))
continue;
return (ENXIO);
porta = aic_inb(aic, PORTA);
- if (isa_get_irq(dev) == -1)
- bus_set_resource(dev, SYS_RES_IRQ, 0, PORTA_IRQ(porta), 1);
+ if (isa_get_irq(dev) == -1) {
+ int irq = PORTA_IRQ(porta);
+
+ bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1,
+ machintr_intr_cpuid(irq));
+ }
if ((aic->flags & AIC_DMA_ENABLE) && isa_get_drq(dev) == -1)
- bus_set_resource(dev, SYS_RES_DRQ, 0, PORTA_DRQ(porta), 1);
+ bus_set_resource(dev, SYS_RES_DRQ, 0, PORTA_DRQ(porta), 1, -1);
device_set_desc(dev, "Adaptec 6260/6360 SCSI controller");
return (0);
}
if (bus_get_resource(dev, SYS_RES_IOPORT, ATA_ALTADDR_RID, &tmp, &tmp)) {
if (len > ATA_IOSIZE) {
bus_set_resource(dev, SYS_RES_IOPORT, ATA_ALTADDR_RID,
- start + ATA_PCCARD_ALTOFFSET, ATA_ALTIOSIZE);
+ start + ATA_PCCARD_ALTOFFSET, ATA_ALTIOSIZE, -1);
}
else {
bus_set_resource(dev, SYS_RES_IOPORT, ATA_ALTADDR_RID,
- start + ATA_ALTOFFSET, ATA_ALTIOSIZE);
+ start + ATA_ALTOFFSET, ATA_ALTIOSIZE, -1);
}
}
else
/* set the altport range */
if (bus_get_resource(dev, SYS_RES_IOPORT, ATA_ALTADDR_RID, &tmp, &tmp)) {
bus_set_resource(dev, SYS_RES_IOPORT, ATA_ALTADDR_RID,
- rman_get_start(io) + ATA_ALTOFFSET, ATA_ALTIOSIZE);
+ rman_get_start(io) + ATA_ALTOFFSET, ATA_ALTIOSIZE, -1);
}
bus_release_resource(dev, SYS_RES_IOPORT, rid, io);
#include <sys/devicestat.h>
#include <sys/sysctl.h>
#include <sys/rman.h>
+#include <sys/machintr.h>
#include <machine/stdarg.h>
#include <machine/clock.h>
return "Promise TX4 ATA100 controller (channel 0+1)";
}
else if (pci_get_slot(dev) == 2 && start && end) {
- bus_set_resource(dev, SYS_RES_IRQ, 0, start, end);
+ bus_set_resource(dev, SYS_RES_IRQ, 0, start, end,
+ machintr_intr_cpuid(start));
start = end = 0;
return "Promise TX4 ATA100 controller (channel 2+3)";
}
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/rman.h>
+#include <sys/machintr.h>
#include <bus/isa/isavar.h>
#include "btreg.h"
bt_isa_release_resources(dev);
- bus_set_resource(dev, SYS_RES_DRQ, 0, info.drq, 1);
- bus_set_resource(dev, SYS_RES_IRQ, 0, info.irq, 1);
+ bus_set_resource(dev, SYS_RES_DRQ, 0, info.drq, 1, -1);
+ bus_set_resource(dev, SYS_RES_IRQ, 0, info.irq, 1,
+ machintr_intr_cpuid(info.irq));
return (0);
}
ctlstart = rman_get_start(fdc->res_ioport) +
fdc->port_off + 7;
- bus_set_resource(dev, SYS_RES_IOPORT, 1, ctlstart, 1);
+ bus_set_resource(dev, SYS_RES_IOPORT, 1, ctlstart, 1,
+ -1);
}
/*
#include <sys/spinlock.h>
#include <sys/systm.h>
#include <sys/taskqueue.h>
+#include <sys/machintr.h>
#include <sys/spinlock2.h>
#include <sys/mplock2.h>
strcat(buffer, " (channel 0+1)");
}
else if (pci_get_slot(dev) == 2 && start && end) {
- bus_set_resource(dev, SYS_RES_IRQ, 0, start, end);
+ bus_set_resource(dev, SYS_RES_IRQ, 0, start, end,
+ machintr_intr_cpuid(start));
strcat(buffer, " (channel 2+3)");
}
else {
/* set the altport range */
if (bus_get_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, &tmp, &tmp)) {
bus_set_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID,
- rman_get_start(io) + ATA_CTLOFFSET, ATA_CTLIOSIZE);
+ rman_get_start(io) + ATA_CTLOFFSET, ATA_CTLIOSIZE, -1);
}
/* allocate the altport range */
/* XXX */
if (bus_get_resource_start(dev, SYS_RES_IOPORT, 1) <= 0) {
bus_set_resource(dev, SYS_RES_IOPORT, 1,
- rman_get_start(port0) + KBD_STATUS_PORT, 1);
+ rman_get_start(port0) + KBD_STATUS_PORT, 1, -1);
}
rid = 1;
port1 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1,
sc->rnum = 0;
while (chunk < IOMEM_END) {
bus_set_resource(child, SYS_RES_MEMORY, sc->rnum, chunk,
- IOMEM_STEP);
+ IOMEM_STEP, -1);
rid = sc->rnum;
res = bus_alloc_resource(child, SYS_RES_MEMORY, &rid, 0ul,
~0ul, IOMEM_STEP, RF_ACTIVE);
}
rom_size = buf[2] << 9;
bus_set_resource(child, SYS_RES_MEMORY, sc->rnum, chunk,
- rom_size);
+ rom_size, -1);
rid = sc->rnum;
res = bus_alloc_resource(child, SYS_RES_MEMORY, &rid, 0ul,
~0ul, rom_size, 0);
return ENXIO;
}
bus_set_resource(dev, SYS_RES_IOPORT, 0, port,
- IO_LPTSIZE_EXTENDED);
+ IO_LPTSIZE_EXTENDED, -1);
}
#endif
#include <sys/thread2.h>
#include <sys/time.h>
#include <sys/uio.h>
+#include <sys/machintr.h>
#include <machine/clock.h>
#include <machine/limits.h>
irq = bus_get_resource_start(psmc, SYS_RES_IRQ, 0);
if (irq <= 0)
return;
- bus_set_resource(psm, SYS_RES_IRQ, KBDC_RID_AUX, irq, 1);
+ bus_set_resource(psm, SYS_RES_IRQ, KBDC_RID_AUX, irq, 1,
+ machintr_intr_cpuid(irq));
}
#define endprobe(v) do { \
/* move our resource to the found device */
irq = bus_get_resource_start(me, SYS_RES_IRQ, 0);
- bus_set_resource(psm, SYS_RES_IRQ, KBDC_RID_AUX, irq, 1);
+ bus_set_resource(psm, SYS_RES_IRQ, KBDC_RID_AUX, irq, 1,
+ machintr_intr_cpuid(irq));
/* ...then probe and attach it */
return (device_probe_and_attach(psm));
irq = 12; /* XXX */
device_printf(dev, "irq resource info is missing; "
"assuming irq %ld\n", irq);
- bus_set_resource(dev, SYS_RES_IRQ, rid, irq, 1);
+ bus_set_resource(dev, SYS_RES_IRQ, rid, irq, 1,
+ machintr_intr_cpuid(irq));
}
res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE);
bus_release_resource(dev, SYS_RES_IRQ, rid, res);
memsize = ar_inb(hc, AR_REV);
memsize = 1 << ((memsize & AR_WSIZ_MSK) >> AR_WSIZ_SHFT);
memsize *= ARC_WIN_SIZ;
- error = bus_set_resource(device, SYS_RES_MEMORY, 0, membase, memsize);
+ error = bus_set_resource(device, SYS_RES_MEMORY, 0, membase, memsize,
+ -1);
ar_deallocate_resources(device);
return (error);
#include <sys/bus.h>
#include <sys/rman.h>
#include <sys/thread2.h>
+#include <sys/machintr.h>
#include <machine/clock.h>
}
}
- if (!error)
+ if (!error) {
bus_set_resource(dev, SYS_RES_IRQ, 0,
- irq, 1);
+ irq, 1, machintr_intr_cpuid(irq));
+ }
}
}
}
#include <sys/bus.h>
#include <sys/rman.h>
#include <sys/thread2.h>
+#include <sys/machintr.h>
#include <net/ethernet.h>
#include <net/if.h>
error = bus_get_resource(dev, SYS_RES_IRQ, 0,
&irq, &junk);
if (error && intr_vals[0] != NULL) {
+ int intr_val = intr_vals[0][iptr];
+
error = bus_set_resource(dev, SYS_RES_IRQ, 0,
- intr_vals[0][iptr], 1);
+ intr_val, 1, machintr_intr_cpuid(intr_val));
}
if (error)
return (error);
error = bus_get_resource(dev, SYS_RES_IRQ, 0,
&irq, &junk);
if (error && intr_vals[1] != NULL) {
+ int intr_val = intr_vals[1][iptr];
+
error = bus_set_resource(dev, SYS_RES_IRQ, 0,
- intr_vals[1][iptr], 1);
+ intr_val, 1, machintr_intr_cpuid(intr_val));
}
if (error)
return (error);
error = bus_get_resource(dev, SYS_RES_IRQ, 0,
&conf_irq, &junk);
if (error) {
- bus_set_resource(dev, SYS_RES_IRQ, 0,
- ed_hpp_intr_val[irq], 1);
+ int intr_val = ed_hpp_intr_val[irq];
+
+ bus_set_resource(dev, SYS_RES_IRQ, 0, intr_val, 1,
+ machintr_intr_cpuid(intr_val));
} else {
if (conf_irq != ed_hpp_intr_val[irq])
return (ENXIO);
#include <sys/interrupt.h>
#include <sys/bus.h>
#include <sys/rman.h>
+#include <sys/machintr.h>
#include <net/if.h>
#include <net/if_arp.h>
ISA_ORDER_SPECULATIVE, "ep", -1);
device_set_desc_copy(child, desc);
device_set_driver(child, driver);
- bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1);
- bus_set_resource(child, SYS_RES_IOPORT, 0, ioport, EP_IOSIZE);
+ bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1,
+ machintr_intr_cpuid(irq));
+ bus_set_resource(child, SYS_RES_IOPORT, 0, ioport, EP_IOSIZE, -1);
if (bootverbose) {
device_printf(parent, "if_ep: <%s> at port 0x%03x-0x%03x irq %d\n",
#include <sys/bus.h>
#include <sys/rman.h>
#include <sys/serialize.h>
+#include <sys/machintr.h>
#include <machine/clock.h>
ISA_ORDER_SPECULATIVE, "ex", -1);
device_set_desc_copy(child, desc);
device_set_driver(child, driver);
- bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1);
- bus_set_resource(child, SYS_RES_IOPORT, 0, ioport, EX_IOSIZE);
+ bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1,
+ machintr_intr_cpuid(irq));
+ bus_set_resource(child, SYS_RES_IOPORT, 0, ioport, EX_IOSIZE, -1);
++count;
if (bootverbose)
}
} else {
irq = ee2irq[tmp];
- bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1);
+ bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1,
+ machintr_intr_cpuid(irq));
}
if (irq == 0) {
#include <sys/socket.h>
#include <sys/module.h>
#include <sys/bus.h>
+#include <sys/machintr.h>
#include <machine/clock.h>
irq = 0;
bus_get_resource(dev, SYS_RES_IRQ, 0, &irq, NULL);
if (irq == NO_IRQ) {
+ int intr = irqmap[n];
+
/* Just use the probed value. */
- bus_set_resource(dev, SYS_RES_IRQ, 0, irqmap[n], 1);
+ bus_set_resource(dev, SYS_RES_IRQ, 0, intr, 1,
+ machintr_intr_cpuid(intr));
} else if (irq != irqmap[n]) {
/* Don't match. */
sc->stability |= UNSTABLE_IRQ;
return ENXIO;
} else if (error && xirq != NO_IRQ) {
/* Just use the probed IRQ value. */
- bus_set_resource(dev, SYS_RES_IRQ, 0, xirq, 1);
+ bus_set_resource(dev, SYS_RES_IRQ, 0, xirq, 1,
+ machintr_intr_cpuid(xirq));
} else if (!error && xirq == NO_IRQ) {
/* No problem. Go ahead. */
} else if (irq == xirq) {
base = pci_read_config(dev, AMDPCI_PMBASE, 4);
base &= 0xff00;
bus_set_resource(dev, SYS_RES_IOPORT, AMDPCI_PMBASE,
- base+0xe0, 32);
+ base+0xe0, 32, -1);
return (BUS_PROBE_DEFAULT);
}
base = pci_read_config(dev, NFPCI_PMBASE, 4);
base &= 0xff00;
bus_set_resource(dev, SYS_RES_IOPORT, NFPCI_PMBASE,
- base, 32);
+ base, 32, -1);
return (BUS_PROBE_DEFAULT);
}
}
}
if (bus_set_resource(child, SYS_RES_IOPORT, 0,
- APS_ADDR_BASE, APS_ADDR_SIZE))
+ APS_ADDR_BASE, APS_ADDR_SIZE, -1))
kprintf("%s: cannot set resource\n", __func__);
}
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/rman.h>
+#include <sys/machintr.h>
#include <bus/smbus/smbconf.h>
#include "smbus_if.h"
/* Force IRQ 9. */
rid = 0;
- if (sc->cfg_irq9)
- bus_set_resource(dev, SYS_RES_IRQ, rid, 9, 1);
+ if (sc->cfg_irq9) {
+ bus_set_resource(dev, SYS_RES_IRQ, rid, 9, 1,
+ machintr_intr_cpuid(9));
+ }
sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
RF_SHAREABLE | RF_ACTIVE);
if (child == NULL)
child = BUS_ADD_CHILD(parent, parent, ISA_ORDER_PNP,
driver->name, 0);
- if (bus_set_resource(child, SYS_RES_IOPORT, 0, port, UGURU_IOSIZE))
+ if (bus_set_resource(child, SYS_RES_IOPORT, 0, port, UGURU_IOSIZE, -1))
kprintf("%s: cannot set resource for child\n", __func__);
#endif
}
* described outside the viapmope of the traditional maps
*/
if (bus_set_resource(dev, SYS_RES_IOPORT, viapm->iorid,
- viapm->base, 256)) {
+ viapm->base, 256, -1)) {
device_printf(dev, "could not set bus resource\n");
return ENXIO;
}
*/
viapm->iorid = base_cfgreg;
if (bus_set_resource(dev, SYS_RES_IOPORT, viapm->iorid,
- viapm->base, 16)) {
+ viapm->base, 16, -1)) {
device_printf(dev, "could not set bus resource 0x%x\n",
viapm->base);
return ENXIO;
} else
continue;
if (bus_set_resource(child[i], SYS_RES_IOPORT, 0,
- port[i], WBSIO_IOSIZE))
+ port[i], WBSIO_IOSIZE, -1))
kprintf("%s: cannot set resource for child[%i]\n",
__func__, i);
}
device_printf(dev, "cannot add child\n");
return ENXIO;
}
- if (bus_set_resource(child, SYS_RES_IOPORT, 0, iobase, 8)) {
+ if (bus_set_resource(child, SYS_RES_IOPORT, 0, iobase, 8, -1)) {
device_printf(dev, "cannot set resource\n");
return ENXIO;
}
bus_release_resource(dev, SYS_RES_IOPORT, sc->res.iorid, sc->res.io);
/* Let digi_isa_attach() know what we've found */
- bus_set_resource(dev, SYS_RES_IOPORT, 0, sc->port, IO_SIZE);
- bus_set_resource(dev, SYS_RES_MEMORY, 0, sc->pmem, sc->win_size);
+ bus_set_resource(dev, SYS_RES_IOPORT, 0, sc->port, IO_SIZE, -1);
+ bus_set_resource(dev, SYS_RES_MEMORY, 0, sc->pmem, sc->win_size, -1);
DLOG(DIGIDB_INIT, (sc->dev, "Probe returns -10\n"));
/* Looks like a GUS MAX. Set the rest of the resources. */
- bus_set_resource(dev, SYS_RES_IOPORT, 2, base + 0x10c, 8);
+ bus_set_resource(dev, SYS_RES_IOPORT, 2, base + 0x10c, 8, -1);
if (flags & DV_F_DUAL_DMA)
bus_set_resource(dev, SYS_RES_DRQ, 1,
- flags & DV_F_DRQ_MASK, 1);
+ flags & DV_F_DRQ_MASK, 1, -1);
/* We can support the CS4231 and MIDI devices. */
* $FreeBSD: src/sys/dev/sound/isa/mss.c,v 1.95.2.3 2006/04/04 17:30:59 ariff Exp $
*/
+#include <sys/machintr.h>
#include <dev/sound/pcm/sound.h>
SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/mss.c,v 1.11 2007/06/16 20:07:18 dillon Exp $");
/* XXX verify this */
setres = 1;
bus_set_resource(dev, SYS_RES_IOPORT, mss->io_rid,
- 0x530, 8);
+ 0x530, 8, -1);
mss->io_base = bus_alloc_resource(dev, SYS_RES_IOPORT, &mss->io_rid,
0, ~0, 8, RF_ACTIVE);
}
mss->drq2_rid = -1;
if (flags & DV_F_DUAL_DMA) {
bus_set_resource(dev, SYS_RES_DRQ, 1,
- flags & DV_F_DRQ_MASK, 1);
+ flags & DV_F_DRQ_MASK, 1, -1);
mss->drq2_rid = 1;
}
mss->bd_id = (device_get_flags(dev) & DV_F_DEV_MASK) >> DV_F_DEV_SHIFT;
if (!mss->conf_base) {
bus_set_resource(dev, SYS_RES_IOPORT, mss->conf_rid,
- mss->optibase, 0x9);
+ mss->optibase, 0x9, -1);
mss->conf_base = bus_alloc_resource(dev, SYS_RES_IOPORT,
&mss->conf_rid, mss->optibase, mss->optibase+0x9,
if (mss->bd_flags & BD_F_924PNP) {
u_int32_t irq = isa_get_irq(dev);
u_int32_t drq = isa_get_drq(dev);
- bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1);
- bus_set_resource(dev, SYS_RES_DRQ, mss->drq1_rid, drq, 1);
+ bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1,
+ machintr_intr_cpuid(irq));
+ bus_set_resource(dev, SYS_RES_DRQ, mss->drq1_rid, drq, 1, -1);
if (flags & DV_F_DUAL_DMA) {
bus_set_resource(dev, SYS_RES_DRQ, 1,
- flags & DV_F_DRQ_MASK, 1);
+ flags & DV_F_DRQ_MASK, 1, -1);
mss->drq2_rid = 1;
}
}
if (!logical_id && (flags & DV_F_DUAL_DMA)) {
bus_set_resource(dev, SYS_RES_DRQ, 1,
- flags & DV_F_DRQ_MASK, 1);
+ flags & DV_F_DRQ_MASK, 1, -1);
}
scp = device_get_softc(dev);
/* Add resources to list of pci resources for this device - from here on
* they look like normal pci resources. */
- bus_set_resource(dev, SYS_RES_IOPORT, SV_PCI_DMAA, sdmaa, SV_PCI_DMAA_SIZE);
- bus_set_resource(dev, SYS_RES_IOPORT, SV_PCI_DMAC, sdmac, SV_PCI_DMAC_SIZE);
+ bus_set_resource(dev, SYS_RES_IOPORT, SV_PCI_DMAA,
+ sdmaa, SV_PCI_DMAA_SIZE, -1);
+ bus_set_resource(dev, SYS_RES_IOPORT, SV_PCI_DMAC,
+ sdmac, SV_PCI_DMAC_SIZE, -1);
/* Cache resource short-cuts for dma_a */
sc->dmaa_rid = SV_PCI_DMAA;
int rid;
u_long start;
u_long count;
+ int cpuid;
};
#
int
bus_generic_set_resource(device_t dev, device_t child, int type, int rid,
- u_long start, u_long count)
+ u_long start, u_long count, int cpuid)
{
int error;
error = EINVAL;
if (dev->parent) {
error = BUS_SET_RESOURCE(dev->parent, child, type, rid,
- start, count);
+ start, count, cpuid);
}
return (error);
}
int
bus_generic_rl_set_resource(device_t dev, device_t child, int type, int rid,
- u_long start, u_long count)
+ u_long start, u_long count, int cpuid)
{
struct resource_list *rl = NULL;
if (!rl)
return(EINVAL);
- resource_list_add(rl, type, rid, start, (start + count - 1), count, -1);
+ resource_list_add(rl, type, rid, start, (start + count - 1), count,
+ cpuid);
return(0);
}
int
bus_set_resource(device_t dev, int type, int rid,
- u_long start, u_long count)
+ u_long start, u_long count, int cpuid)
{
return(BUS_SET_RESOURCE(device_get_parent(dev), dev, type, rid,
- start, count));
+ start, count, cpuid));
}
int
sc->sc_resources.io_rid[rid] = rid;
- bus_set_resource(dev, SYS_RES_IOPORT, rid, base, len);
+ bus_set_resource(dev, SYS_RES_IOPORT, rid, base, len, -1);
if(!(sc->sc_resources.io_base[rid] =
bus_alloc_resource(dev, SYS_RES_IOPORT,
sc->sc_resources.io_rid[2] = 2;
- bus_set_resource(dev, SYS_RES_IOPORT, 2, iobase1-0x20, 0x40);
+ bus_set_resource(dev, SYS_RES_IOPORT, 2, iobase1-0x20, 0x40, -1);
if(!(sc->sc_resources.io_base[2] =
bus_alloc_resource(dev, SYS_RES_IOPORT,
*/
#if 0
- bus_set_resource(dev, SYS_RES_IOPORT, 3, iobase2-0x20, 0x20);
+ bus_set_resource(dev, SYS_RES_IOPORT, 3, iobase2-0x20, 0x20, -1);
#else
- bus_set_resource(dev, SYS_RES_IOPORT, 3, iobase2-0x20, 0x10);
+ bus_set_resource(dev, SYS_RES_IOPORT, 3, iobase2-0x20, 0x10, -1);
#endif
if(!(sc->sc_resources.io_base[3] =
sc->sc_resources.io_rid[4] = 4;
- bus_set_resource(dev, SYS_RES_IOPORT, 4, iobase2, 0x40);
+ bus_set_resource(dev, SYS_RES_IOPORT, 4, iobase2, 0x40, -1);
if(!(sc->sc_resources.io_base[4] =
bus_alloc_resource(dev,SYS_RES_IOPORT,
{
sc->sc_resources.io_rid[5] = 5;
- bus_set_resource(dev, SYS_RES_IOPORT, 5, iocfg, 0x01);
+ bus_set_resource(dev, SYS_RES_IOPORT, 5, iocfg, 0x01, -1);
if(!(sc->sc_resources.io_base[5] =
bus_alloc_resource(dev,SYS_RES_IOPORT,
/* set io port resources */
sc->sc_resources.io_rid[0] = 0;
- bus_set_resource(dev, SYS_RES_IOPORT, 0, sc->sc_port, 0x20);
+ bus_set_resource(dev, SYS_RES_IOPORT, 0, sc->sc_port, 0x20, -1);
sc->sc_resources.io_base[0] =
bus_alloc_resource(dev, SYS_RES_IOPORT,
&sc->sc_resources.io_rid[0],
}
sc->sc_resources.io_rid[1] = 1;
bus_set_resource(dev, SYS_RES_IOPORT, 1,
- sc->sc_port-ISAC_OFFS, 0x20);
+ sc->sc_port-ISAC_OFFS, 0x20, -1);
sc->sc_resources.io_base[1] =
bus_alloc_resource(dev, SYS_RES_IOPORT,
&sc->sc_resources.io_rid[1],
sc->sc_resources.io_rid[2] = 2;
bus_set_resource(dev, SYS_RES_IOPORT, 2,
- sc->sc_port-HSCXA_OFFS, 0x20);
+ sc->sc_port-HSCXA_OFFS, 0x20, -1);
sc->sc_resources.io_base[2] =
bus_alloc_resource(dev, SYS_RES_IOPORT,
&sc->sc_resources.io_rid[2],
sc->sc_resources.io_rid[3] = 3;
bus_set_resource(dev, SYS_RES_IOPORT, 3,
- sc->sc_port-HSCXB_OFFS, 0x20);
+ sc->sc_port-HSCXB_OFFS, 0x20, -1);
sc->sc_resources.io_base[3] =
bus_alloc_resource(dev, SYS_RES_IOPORT,
&sc->sc_resources.io_rid[3],
return 1;
sc->sc_resources.io_rid[num] = num;
- bus_set_resource(dev, SYS_RES_IOPORT, num, base, 1);
+ bus_set_resource(dev, SYS_RES_IOPORT, num, base, 1, -1);
if(!(sc->sc_resources.io_base[num] =
bus_alloc_resource(dev, SYS_RES_IOPORT,
return 1;
sc->sc_resources.io_rid[num] = num;
- bus_set_resource(dev, SYS_RES_IOPORT, num, base+i*1024, 8);
+ bus_set_resource(dev, SYS_RES_IOPORT, num, base+i*1024, 8, -1);
if(!(sc->sc_resources.io_base[num] =
bus_alloc_resource(dev, SYS_RES_IOPORT,
return 1;
sc->sc_resources.io_rid[num] = num;
- bus_set_resource(dev, SYS_RES_IOPORT, num, base+i*1024, 8);
+ bus_set_resource(dev, SYS_RES_IOPORT, num, base+i*1024, 8, -1);
if(!(sc->sc_resources.io_base[num] =
bus_alloc_resource(dev, SYS_RES_IOPORT,
return 1;
sc->sc_resources.io_rid[num] = num;
- bus_set_resource(dev, SYS_RES_IOPORT, num, base+i*1024, 8);
+ bus_set_resource(dev, SYS_RES_IOPORT, num, base+i*1024, 8, -1);
if(!(sc->sc_resources.io_base[num] =
bus_alloc_resource(dev, SYS_RES_IOPORT,
void **, lwkt_serialize_t);
static int nexus_teardown_intr(device_t, device_t, struct resource *,
void *);
-static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long);
+static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long,
+ int);
static int nexus_get_resource(device_t, device_t, int, int, u_long *, u_long *);
static void nexus_delete_resource(device_t, device_t, int, int);
}
static int
-nexus_set_resource(device_t dev, device_t child, int type, int rid, u_long start, u_long count)
+nexus_set_resource(device_t dev, device_t child, int type, int rid,
+ u_long start, u_long count, int cpuid)
{
struct nexus_device *ndev = DEVTONX(child);
struct resource_list *rl = &ndev->nx_resources;
/* XXX this should return a success/failure indicator */
- resource_list_add(rl, type, rid, start, start + count - 1, count, -1);
+ resource_list_add(rl, type, rid, start, start + count - 1, count,
+ cpuid);
return(0);
}
void **, lwkt_serialize_t);
static int nexus_teardown_intr(device_t, device_t, struct resource *,
void *);
-static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long);
+static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long,
+ int);
static int nexus_get_resource(device_t, device_t, int, int, u_long *, u_long *);
static void nexus_delete_resource(device_t, device_t, int, int);
}
static int
-nexus_set_resource(device_t dev, device_t child, int type, int rid, u_long start, u_long count)
+nexus_set_resource(device_t dev, device_t child, int type, int rid,
+ u_long start, u_long count, int cpuid)
{
struct nexus_device *ndev = DEVTONX(child);
struct resource_list *rl = &ndev->nx_resources;
/* XXX this should return a success/failure indicator */
- resource_list_add(rl, type, rid, start, start + count - 1, count, -1);
+ resource_list_add(rl, type, rid, start, start + count - 1, count,
+ cpuid);
return(0);
}
int type, int rid, struct resource *r);
int bus_generic_get_resource(device_t dev, device_t child, int type,
int rid, u_long *startp, u_long *countp);
-int bus_generic_set_resource(device_t dev, device_t child, int type,
- int rid, u_long start, u_long count);
+int bus_generic_set_resource(device_t dev, device_t child,
+ int type, int rid, u_long start, u_long count, int cpuid);
void bus_generic_delete_resource(device_t dev, device_t child,
int type, int rid);
int bus_generic_resume(device_t dev);
int bus_generic_rl_get_resource (device_t, device_t, int, int, u_long *,
u_long *);
int bus_generic_rl_set_resource (device_t, device_t, int, int, u_long,
- u_long);
+ u_long, int);
int bus_generic_rl_release_resource (device_t, device_t, int, int,
struct resource *);
void **cookiep, lwkt_serialize_t serializer);
int bus_teardown_intr(device_t dev, struct resource *r, void *cookie);
int bus_set_resource(device_t dev, int type, int rid,
- u_long start, u_long count);
+ u_long start, u_long count, int cpuid);
int bus_get_resource(device_t dev, int type, int rid,
u_long *startp, u_long *countp);
u_long bus_get_resource_start(device_t dev, int type, int rid);