Fix things so that pci interrupts can be registered correctly on apecs

and lca machines (which route PCI interrupts through the ISA PIC).

Reviewed by: dima
This commit is contained in:
Doug Rabson 1998-11-18 23:53:12 +00:00
parent eae8e50443
commit 75410e3d0e
2 changed files with 17 additions and 8 deletions

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: isa.c,v 1.5 1998/10/25 01:30:16 paul Exp $
* $Id: isa.c,v 1.6 1998/11/15 18:25:16 dfr Exp $
*/
#include <sys/param.h>
@ -468,27 +468,36 @@ isa_alloc_resource(device_t bus, device_t child, int type, int *rid,
{
int isdefault;
struct resource *rv, **rvp;
struct isa_device *id = DEVTOISA(child);
struct isa_device *id;
if (child)
id = DEVTOISA(child);
else
id = NULL;
isdefault = (start == 0UL && end == ~0UL && *rid == 0);
if (*rid > 1)
return 0;
switch (type) {
case SYS_RES_IRQ:
if (isdefault && id->id_irq[0] >= 0) {
/*
* The hack implementation of intr_create() passes a
* NULL child device.
*/
if (isdefault && (id == NULL || id->id_irq[0] >= 0)) {
start = id->id_irq[0];
end = id->id_irq[0];
count = 1;
}
rvp = &id->id_irqres[*rid];
rv = rman_reserve_resource(&isa_irq_rman,
start, end, count,
0, child);
if (!rv)
return 0;
*rvp = rv;
id->id_irq[*rid] = rv->r_start;
if (id) {
id->id_irqres[*rid] = rv;
id->id_irq[*rid] = rv->r_start;
}
return rv;
case SYS_RES_MEMORY:

View File

@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: pcibus.c,v 1.5 1998/10/06 14:18:40 dfr Exp $
* $Id: pcibus.c,v 1.6 1998/11/15 18:25:16 dfr Exp $
*
*/
@ -145,7 +145,7 @@ intr_create(void *dev_instance, int irq, inthand2_t handler, void *arg,
int zero = 0;
void *cookie;
res = BUS_ALLOC_RESOURCE(pcib, pcib, SYS_RES_IRQ, &zero,
res = BUS_ALLOC_RESOURCE(pcib, NULL, SYS_RES_IRQ, &zero,
irq, irq, 1, RF_SHAREABLE | RF_ACTIVE);
if (BUS_SETUP_INTR(pcib, pcib, res, (driver_intr_t *)handler, arg, &cookie))
return 0;