Allow pnpbios_getirqnum() to return the share type, as well.

This commit is contained in:
thorpej 2000-04-22 06:38:24 +00:00
parent caa2beb10e
commit 1842a5ee3a
6 changed files with 22 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ess_pnpbios.c,v 1.3 2000/03/04 23:08:54 nathanw Exp $ */
/* $NetBSD: ess_pnpbios.c,v 1.4 2000/04/22 06:38:24 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -101,12 +101,14 @@ ess_pnpbios_attach(parent, self, aux)
sc->sc_audio1.ist = IST_EDGE;
sc->sc_audio2.ist = IST_EDGE;
if (pnpbios_getirqnum(aa->pbt, aa->resc, 0, &sc->sc_audio1.irq)) {
if (pnpbios_getirqnum(aa->pbt, aa->resc, 0, &sc->sc_audio1.irq,
NULL)) {
printf(": can't get IRQ\n");
return;
}
if (pnpbios_getirqnum(aa->pbt, aa->resc, 1, &sc->sc_audio2.irq))
if (pnpbios_getirqnum(aa->pbt, aa->resc, 1, &sc->sc_audio2.irq,
NULL))
sc->sc_audio2.irq = -1;
if (pnpbios_getdmachan(aa->pbt, aa->resc, 0, &sc->sc_audio1.drq)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: pnpbios.c,v 1.12 2000/03/01 20:23:55 groo Exp $ */
/* $NetBSD: pnpbios.c,v 1.13 2000/04/22 06:38:24 thorpej Exp $ */
/*
* Copyright (c) 2000 Christian E. Hopps. All rights reserved.
* Copyright (c) 1999
@ -1239,11 +1239,12 @@ pnpbios_intr_establish(pbt, resc, idx, level, fcn, arg)
}
int
pnpbios_getirqnum(pbt, resc, idx, irqp)
pnpbios_getirqnum(pbt, resc, idx, irqp, istp)
pnpbios_tag_t pbt;
struct pnpresources *resc;
int idx;
int *irqp;
int *istp;
{
struct pnp_irq *irq;
@ -1254,7 +1255,10 @@ pnpbios_getirqnum(pbt, resc, idx, irqp)
while (idx--)
irq = SIMPLEQ_NEXT(irq, next);
*irqp = ffs(irq->mask) - 1;
if (irqp != NULL)
*irqp = ffs(irq->mask) - 1;
if (istp != NULL)
*istp = (irq->flags & 0x0c) ? IST_LEVEL : IST_EDGE;
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pnpbiosvar.h,v 1.3 2000/03/01 20:23:55 groo Exp $ */
/* $NetBSD: pnpbiosvar.h,v 1.4 2000/04/22 06:38:24 thorpej Exp $ */
/*
* Copyright (c) 1999
* Matthias Drochner. All rights reserved.
@ -94,7 +94,8 @@ void *pnpbios_intr_establish __P((pnpbios_tag_t, struct pnpresources *, int,
int pnpbios_getiobase __P((pnpbios_tag_t, struct pnpresources *, int,
bus_space_tag_t *, int *));
int pnpbios_getirqnum __P((pnpbios_tag_t, struct pnpresources *, int, int *));
int pnpbios_getirqnum __P((pnpbios_tag_t, struct pnpresources *, int, int *,
int *));
int pnpbios_getdmachan __P((pnpbios_tag_t, struct pnpresources *, int, int *));
void pnpbios_print_devres __P((struct device *,
struct pnpbiosdev_attach_args *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: sb_pnpbios.c,v 1.2 1999/11/14 02:15:51 thorpej Exp $ */
/* $NetBSD: sb_pnpbios.c,v 1.3 2000/04/22 06:38:24 thorpej Exp $ */
/*
* Copyright (c) 1999
* Matthias Drochner. All rights reserved.
@ -89,7 +89,8 @@ sb_pnpbios_attach(parent, self, aux)
/* XXX These are only for setting chip configuration registers. */
pnpbios_getiobase(aa->pbt, aa->resc, 0, 0, &sc->sc_iobase);
if (pnpbios_getirqnum(aa->pbt, aa->resc, 0, &sc->sc_irq)) {
if (pnpbios_getirqnum(aa->pbt, aa->resc, 0, &sc->sc_irq,
NULL)) {
printf(": can't get IRQ\n");
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: wss_pnpbios.c,v 1.3 2000/02/20 22:03:49 groo Exp $ */
/* $NetBSD: wss_pnpbios.c,v 1.4 2000/04/22 06:38:24 thorpej Exp $ */
/*
* Copyright (c) 1999
* Matthias Drochner. All rights reserved.
@ -131,7 +131,7 @@ wss_pnpbios_attach(parent, self, aux)
sc->wss_ic = aa->ic;
if (pnpbios_getirqnum(aa->pbt, aa->resc, 0, &sc->wss_irq)) {
if (pnpbios_getirqnum(aa->pbt, aa->resc, 0, &sc->wss_irq, NULL)) {
printf(": can't get IRQ\n");
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ym_pnpbios.c,v 1.2 1999/11/14 02:15:51 thorpej Exp $ */
/* $NetBSD: ym_pnpbios.c,v 1.3 2000/04/22 06:38:25 thorpej Exp $ */
/*
* Copyright (c) 1999
* Matthias Drochner. All rights reserved.
@ -118,7 +118,7 @@ ym_pnpbios_attach(parent, self, aux)
sc->sc_ic = aa->ic;
if (pnpbios_getirqnum(aa->pbt, aa->resc, 0, &sc->ym_irq)) {
if (pnpbios_getirqnum(aa->pbt, aa->resc, 0, &sc->ym_irq, NULL)) {
printf(": can't get IRQ\n");
return;
}