diff options
author | imp <imp@FreeBSD.org> | 2006-04-20 04:16:02 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2006-04-20 04:16:02 +0000 |
commit | d49b1fe00a3e60e11af070c72c567f0d455aa936 (patch) | |
tree | 13d11f651260cfa1e981e2dfc7cb3839d56da75b /sys/alpha/pci | |
parent | 09e17e600a13fabcd3d635b0147237e34c7bc0b3 (diff) | |
download | FreeBSD-src-d49b1fe00a3e60e11af070c72c567f0d455aa936.zip FreeBSD-src-d49b1fe00a3e60e11af070c72c567f0d455aa936.tar.gz |
Set the rid for any resources that are allocated at the level where
they first emerge from the rman_* system.
Diffstat (limited to 'sys/alpha/pci')
-rw-r--r-- | sys/alpha/pci/apecs_pci.c | 11 | ||||
-rw-r--r-- | sys/alpha/pci/lca_pci.c | 11 | ||||
-rw-r--r-- | sys/alpha/pci/pcibus.c | 16 |
3 files changed, 28 insertions, 10 deletions
diff --git a/sys/alpha/pci/apecs_pci.c b/sys/alpha/pci/apecs_pci.c index d074563..40af5cc 100644 --- a/sys/alpha/pci/apecs_pci.c +++ b/sys/alpha/pci/apecs_pci.c @@ -79,12 +79,17 @@ static struct resource * apecs_pcib_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 resource *rv = NULL; + if ((hwrpb->rpb_type == ST_DEC_2100_A50) && (type == SYS_RES_IRQ)) - return isa_alloc_intr(bus, child, start); + rv = isa_alloc_intr(bus, child, start); else - return alpha_pci_alloc_resource(bus, child, type, rid, - start, end, count, flags); + rv = alpha_pci_alloc_resource(bus, child, type, rid, + start, end, count, flags); + if (rv != NULL) + rman_set_rid(rv, *rid); + return (rv); } static int diff --git a/sys/alpha/pci/lca_pci.c b/sys/alpha/pci/lca_pci.c index 54a55d4..3b05e63 100644 --- a/sys/alpha/pci/lca_pci.c +++ b/sys/alpha/pci/lca_pci.c @@ -78,11 +78,16 @@ static struct resource * lca_pcib_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 resource *rv = NULL; + if (type == SYS_RES_IRQ) - return isa_alloc_intr(bus, child, start); + rv = isa_alloc_intr(bus, child, start); else - return alpha_pci_alloc_resource(bus, child, type, rid, - start, end, count, flags); + rv = alpha_pci_alloc_resource(bus, child, type, rid, + start, end, count, flags); + if (rv != NULL) + rman_set_rid(rv, *rid); + return (rv); } static int diff --git a/sys/alpha/pci/pcibus.c b/sys/alpha/pci/pcibus.c index d78015c..c4013fc 100644 --- a/sys/alpha/pci/pcibus.c +++ b/sys/alpha/pci/pcibus.c @@ -96,7 +96,12 @@ struct resource * alpha_platform_alloc_ide_intr(int chan) { int irqs[2] = { 14, 15 }; - return isa_alloc_intr(0, 0, irqs[chan]); + struct resource *rv; + + rv = isa_alloc_intr(0, 0, irqs[chan]); + if (rv != NULL) + rman_set_rid(rv, *rid); + return (rv); } int @@ -230,9 +235,11 @@ alpha_pci_alloc_resource(device_t bus, device_t child, int type, int *rid, #ifdef DEV_ISA if((start >= ISA_IRQ_OFFSET) && (end < ISA_IRQ_OFFSET + ISA_IRQ_LEN)) { - return isa_alloc_intrs(bus, child, - start - ISA_IRQ_OFFSET, - end - ISA_IRQ_OFFSET); + rv = isa_alloc_intrs(bus, child, + start - ISA_IRQ_OFFSET, end - ISA_IRQ_OFFSET); + if (rv != NULL) + rman_set_rid(rv, *rid); + return (rv); } else #endif @@ -252,6 +259,7 @@ alpha_pci_alloc_resource(device_t bus, device_t child, int type, int *rid, if (rv == 0) return 0; + rman_set_rid(rv, *rid); rstart = rman_get_start(rv); rman_set_bustag(rv, ALPHAPCI_GET_BUSTAG(bus, type)); rman_set_bushandle(rv, rstart); |