Make PCI interrupt handlers return void like everybody else does.
Reviewed by: davidg
This commit is contained in:
parent
ac09ec5108
commit
dd7610fca4
@ -21,7 +21,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: if_de.c,v 1.39 1995/12/07 12:47:34 davidg Exp $
|
||||
* $Id: if_de.c,v 1.40 1995/12/14 09:53:58 phk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -1423,7 +1423,7 @@ tulip_start(
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
static void
|
||||
tulip_intr(
|
||||
void *arg)
|
||||
{
|
||||
@ -1467,7 +1467,6 @@ tulip_intr(
|
||||
}
|
||||
}
|
||||
} while ((sc = sc->tulip_slaves) != NULL);
|
||||
return progress;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -29,7 +29,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_fxp.c,v 1.7 1996/01/03 05:22:32 davidg Exp $
|
||||
* $Id: if_fxp.c,v 1.8 1996/01/15 10:12:41 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -138,7 +138,7 @@ static inline int fxp_scb_wait __P((struct fxp_csr *));
|
||||
static char *fxp_probe __P((pcici_t, pcidi_t));
|
||||
static void fxp_attach __P((pcici_t, int));
|
||||
static int fxp_shutdown __P((struct kern_devconf *, int));
|
||||
static int fxp_intr __P((void *));
|
||||
static void fxp_intr __P((void *));
|
||||
static void fxp_start __P((struct ifnet *));
|
||||
static int fxp_ioctl __P((struct ifnet *, int, caddr_t));
|
||||
static void fxp_init __P((struct ifnet *));
|
||||
@ -545,18 +545,16 @@ tbdinit:
|
||||
* Process interface interrupts. Returns 1 if the interrupt
|
||||
* was handled, 0 if it wasn't.
|
||||
*/
|
||||
static int
|
||||
static void
|
||||
fxp_intr(arg)
|
||||
void *arg;
|
||||
{
|
||||
struct fxp_softc *sc = arg;
|
||||
struct fxp_csr *csr = sc->csr;
|
||||
struct ifnet *ifp = &sc->arpcom.ac_if;
|
||||
int found = 0;
|
||||
u_char statack;
|
||||
|
||||
while ((statack = csr->scb_statack) != 0) {
|
||||
found = 1;
|
||||
/*
|
||||
* First ACK all the interrupts in this pass.
|
||||
*/
|
||||
@ -653,8 +651,6 @@ rcvloop:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** $Id: pci.c,v 1.39 1995/12/16 00:27:46 bde Exp $
|
||||
** $Id: pci.c,v 1.40 1996/01/19 19:01:19 se Exp $
|
||||
**
|
||||
** General subroutines for the PCI bus.
|
||||
** pci_configure ()
|
||||
@ -1149,38 +1149,23 @@ static void
|
||||
pci_int (int irq)
|
||||
{
|
||||
struct pci_int_desc * p;
|
||||
int c, s;
|
||||
#ifdef PCI_EDGE_INT
|
||||
int i, n;
|
||||
#endif
|
||||
int s;
|
||||
|
||||
if (irq<0 || irq >= PCI_MAX_IRQ) {
|
||||
printf ("pci_int: irq %d out of range, ignored\n", irq);
|
||||
return;
|
||||
};
|
||||
|
||||
#ifdef PCI_EDGE_INT
|
||||
for (i=0; i<1000; i++) {
|
||||
n = 0;
|
||||
#endif
|
||||
for (p = pci_int_desc[irq]; p!=NULL; p=p->pcid_next) {
|
||||
s = splq (*p->pcid_maskptr);
|
||||
c= (*p->pcid_handler) (p->pcid_argument);
|
||||
p-> pcid_tally += c;
|
||||
splx (s);
|
||||
#ifdef PCI_EDGE_INT
|
||||
n += c;
|
||||
#endif
|
||||
for (p = pci_int_desc[irq]; p!=NULL; p=p->pcid_next) {
|
||||
s = splq (*p->pcid_maskptr);
|
||||
(*p->pcid_handler) (p->pcid_argument);
|
||||
p-> pcid_tally++;
|
||||
splx (s);
|
||||
#if 0
|
||||
if (c && p->pcid_tally<20)
|
||||
if (p->pcid_tally<20)
|
||||
printf ("PCI_INT: irq=%d h=%p cpl o=%x n=%x val=%d\n",
|
||||
irq, p->pcid_handler, s, cpl, c);
|
||||
irq, p->pcid_handler, s, cpl, c);
|
||||
#endif
|
||||
};
|
||||
#ifdef PCI_EDGE_INT
|
||||
if (!n) return;
|
||||
};
|
||||
printf ("pci_int(%d): permanent interrupt request.\n", irq);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** $Id: pcivar.h,v 1.6 1995/05/30 08:13:12 rgrimes Exp $
|
||||
** $Id: pcivar.h,v 1.7 1995/11/21 12:54:55 bde Exp $
|
||||
**
|
||||
** Declarations for pci device drivers.
|
||||
**
|
||||
@ -228,17 +228,10 @@ int pci_map_port (pcici_t tag, u_long entry, u_short * pa);
|
||||
**
|
||||
** Supports multiple handlers per irq (shared interrupts).
|
||||
**
|
||||
** -----------------
|
||||
**
|
||||
** There is code to support shared edge triggered ints.
|
||||
** This relies on the cooperation of the interrupt handlers:
|
||||
** they have to return a value <>0 if and only if something
|
||||
** was done. Beware of the performance penalty.
|
||||
**
|
||||
**-----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
typedef int pci_inthand_t(void *arg);
|
||||
typedef void pci_inthand_t(void *arg);
|
||||
|
||||
struct pci_int_desc {
|
||||
struct pci_int_desc * pcid_next;
|
||||
|
@ -19,7 +19,7 @@
|
||||
* 4. Modifications may be freely made to this file if the above conditions
|
||||
* are met.
|
||||
*
|
||||
* $Id: aic7770.c,v 1.20 1995/12/14 23:23:48 bde Exp $
|
||||
* $Id: aic7770.c,v 1.21 1996/01/03 06:28:00 gibbs Exp $
|
||||
*/
|
||||
|
||||
#include "eisa.h"
|
||||
@ -188,7 +188,7 @@ aic7770_attach(e_dev)
|
||||
* The IRQMS bit enables level sensitive interrupts only allow
|
||||
* IRQ sharing if its set.
|
||||
*/
|
||||
if(eisa_reg_intr(e_dev, irq, ahc_eisa_intr, (void *)ahc, &bio_imask,
|
||||
if(eisa_reg_intr(e_dev, irq, ahc_intr, (void *)ahc, &bio_imask,
|
||||
/*shared ==*/ahc->pause & IRQMS)) {
|
||||
ahc_free(ahc);
|
||||
return -1;
|
||||
@ -307,7 +307,7 @@ aic7770_attach(e_dev)
|
||||
* The board's IRQ line is not yet enabled so its safe
|
||||
* to release the irq.
|
||||
*/
|
||||
eisa_release_intr(e_dev, irq, ahc_eisa_intr);
|
||||
eisa_release_intr(e_dev, irq, ahc_intr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -321,7 +321,7 @@ aic7770_attach(e_dev)
|
||||
*/
|
||||
if(eisa_enable_intr(e_dev, irq)) {
|
||||
ahc_free(ahc);
|
||||
eisa_release_intr(e_dev, irq, ahc_eisa_intr);
|
||||
eisa_release_intr(e_dev, irq, ahc_intr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
*
|
||||
* commenced: Sun Sep 27 18:14:01 PDT 1992
|
||||
*
|
||||
* $Id: aic7xxx.c,v 1.52 1996/01/05 16:13:44 gibbs Exp $
|
||||
* $Id: aic7xxx.c,v 1.53 1996/01/07 19:24:31 gibbs Exp $
|
||||
*/
|
||||
/*
|
||||
* TODO:
|
||||
@ -497,8 +497,8 @@ void ahc_add_waiting_scb (iobase, scb, where)
|
||||
/*
|
||||
* Catch an interrupt from the adaptor
|
||||
*/
|
||||
int
|
||||
ahcintr(arg)
|
||||
void
|
||||
ahc_intr(arg)
|
||||
void *arg;
|
||||
{
|
||||
int intstat;
|
||||
@ -515,7 +515,7 @@ ahcintr(arg)
|
||||
* someone who is sharing my interrupt
|
||||
*/
|
||||
if (!(intstat & INT_PEND))
|
||||
return 0;
|
||||
return;
|
||||
|
||||
if (intstat & BRKADRINT) {
|
||||
/* We upset the sequencer :-( */
|
||||
@ -811,7 +811,7 @@ ahcintr(arg)
|
||||
*/
|
||||
outb(RETURN_1 + iobase, 0);
|
||||
if (!scb || !(scb->flags & SCB_ACTIVE)) {
|
||||
printf("ahc%d:%c:%d: ahcintr - referenced scb "
|
||||
printf("ahc%d:%c:%d: ahc_intr - referenced scb "
|
||||
"not valid during seqint 0x%x scb(%d)\n",
|
||||
ahc->unit, channel, target, intstat,
|
||||
scb_index);
|
||||
@ -1012,7 +1012,7 @@ ahcintr(arg)
|
||||
outb(MSG_LEN + iobase, 1);
|
||||
}
|
||||
else
|
||||
panic("ahcintr: AWAITING_MSG for an SCB that"
|
||||
panic("ahc_intr: AWAITING_MSG for an SCB that"
|
||||
"does not have a waiting message");
|
||||
break;
|
||||
}
|
||||
@ -1052,7 +1052,7 @@ ahcintr(arg)
|
||||
#endif
|
||||
}
|
||||
else
|
||||
panic("ahcintr: Immediate complete for "
|
||||
panic("ahc_intr: Immediate complete for "
|
||||
"unknown operation.");
|
||||
break;
|
||||
}
|
||||
@ -1092,7 +1092,7 @@ clear:
|
||||
|
||||
scb = ahc->scbarray[scb_index];
|
||||
if (!scb || !(scb->flags & SCB_ACTIVE)) {
|
||||
printf("ahc%d: ahcintr - referenced scb not "
|
||||
printf("ahc%d: ahc_intr - referenced scb not "
|
||||
"valid during scsiint 0x%x scb(%d)\n",
|
||||
ahc->unit, status, scb_index);
|
||||
outb(CLRSINT1 + iobase, status);
|
||||
@ -1234,14 +1234,6 @@ cmdcomplete:
|
||||
|
||||
} while (inb(QOUTCNT + iobase));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
ahc_eisa_intr(arg)
|
||||
void *arg;
|
||||
{
|
||||
ahcintr(arg);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -20,7 +20,7 @@
|
||||
* 4. Modifications may be freely made to this file if the above conditions
|
||||
* are met.
|
||||
*
|
||||
* $Id: aic7xxx.h,v 1.17 1996/01/03 06:32:12 gibbs Exp $
|
||||
* $Id: aic7xxx.h,v 1.18 1996/01/07 19:24:33 gibbs Exp $
|
||||
*/
|
||||
|
||||
#ifndef _AIC7XXX_H_
|
||||
@ -206,7 +206,6 @@ struct ahc_data *ahc_alloc __P((int unit, u_long io_base, ahc_type type, ahc_fla
|
||||
void ahc_free __P((struct ahc_data *));
|
||||
int ahc_init __P((struct ahc_data *));
|
||||
int ahc_attach __P((struct ahc_data *));
|
||||
void ahc_eisa_intr __P((void *arg));
|
||||
int ahcintr __P((void *arg));
|
||||
void ahc_intr __P((void *arg));
|
||||
|
||||
#endif /* _AIC7XXX_H_ */
|
||||
|
@ -19,7 +19,7 @@
|
||||
* 4. Modifications may be freely made to this file if the above conditions
|
||||
* are met.
|
||||
*
|
||||
* $Id: aic7870.c,v 1.22 1996/01/07 19:26:11 gibbs Exp $
|
||||
* $Id: aic7870.c,v 1.23 1996/01/09 16:14:53 gibbs Exp $
|
||||
*/
|
||||
|
||||
#include <pci.h>
|
||||
@ -311,7 +311,7 @@ aic7870_attach(config_id, unit)
|
||||
if(!(ahc = ahc_alloc(unit, io_port, ahc_t, ahc_f)))
|
||||
return; /* XXX PCI code should take return status */
|
||||
|
||||
if(!(pci_map_int(config_id, ahcintr, (void *)ahc, &bio_imask))) {
|
||||
if(!(pci_map_int(config_id, ahc_intr, (void *)ahc, &bio_imask))) {
|
||||
ahc_free(ahc);
|
||||
return;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
* 4. Modifications may be freely made to this file if the above conditions
|
||||
* are met.
|
||||
*
|
||||
* $Id: bt9xx.c,v 1.2 1995/12/14 09:53:56 phk Exp $
|
||||
* $Id: bt9xx.c,v 1.3 1995/12/14 14:19:19 peter Exp $
|
||||
*/
|
||||
|
||||
#include <pci.h>
|
||||
@ -40,7 +40,6 @@
|
||||
|
||||
static char* bt_pci_probe __P((pcici_t tag, pcidi_t type));
|
||||
static void bt_pci_attach __P((pcici_t config_id, int unit));
|
||||
static int bt_pci_intr __P((void *arg));
|
||||
|
||||
static struct pci_device bt_pci_driver = {
|
||||
"bt",
|
||||
@ -86,7 +85,7 @@ bt_pci_attach(config_id, unit)
|
||||
if(!(bt = bt_alloc(unit, io_port)))
|
||||
return; /* XXX PCI code should take return status */
|
||||
|
||||
if(!(pci_map_int(config_id, bt_pci_intr, (void *)bt, &bio_imask))) {
|
||||
if(!(pci_map_int(config_id, bt_intr, (void *)bt, &bio_imask))) {
|
||||
bt_free(bt);
|
||||
return;
|
||||
}
|
||||
@ -112,22 +111,4 @@ bt_pci_attach(config_id, unit)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle an PCI interrupt.
|
||||
* XXX should go away as soon as PCI interrupt handlers
|
||||
* return void.
|
||||
*/
|
||||
static int
|
||||
bt_pci_intr(arg)
|
||||
void *arg;
|
||||
{
|
||||
bt_intr(arg);
|
||||
return (1); /*
|
||||
* XXX: Always say we handle the interrupt.
|
||||
* won't work with edge-triggered ints.
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
#endif /* NPCI > 0 */
|
||||
|
@ -21,7 +21,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: if_de.c,v 1.39 1995/12/07 12:47:34 davidg Exp $
|
||||
* $Id: if_de.c,v 1.40 1995/12/14 09:53:58 phk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -1423,7 +1423,7 @@ tulip_start(
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
static void
|
||||
tulip_intr(
|
||||
void *arg)
|
||||
{
|
||||
@ -1467,7 +1467,6 @@ tulip_intr(
|
||||
}
|
||||
}
|
||||
} while ((sc = sc->tulip_slaves) != NULL);
|
||||
return progress;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -29,7 +29,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_fxp.c,v 1.7 1996/01/03 05:22:32 davidg Exp $
|
||||
* $Id: if_fxp.c,v 1.8 1996/01/15 10:12:41 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -138,7 +138,7 @@ static inline int fxp_scb_wait __P((struct fxp_csr *));
|
||||
static char *fxp_probe __P((pcici_t, pcidi_t));
|
||||
static void fxp_attach __P((pcici_t, int));
|
||||
static int fxp_shutdown __P((struct kern_devconf *, int));
|
||||
static int fxp_intr __P((void *));
|
||||
static void fxp_intr __P((void *));
|
||||
static void fxp_start __P((struct ifnet *));
|
||||
static int fxp_ioctl __P((struct ifnet *, int, caddr_t));
|
||||
static void fxp_init __P((struct ifnet *));
|
||||
@ -545,18 +545,16 @@ tbdinit:
|
||||
* Process interface interrupts. Returns 1 if the interrupt
|
||||
* was handled, 0 if it wasn't.
|
||||
*/
|
||||
static int
|
||||
static void
|
||||
fxp_intr(arg)
|
||||
void *arg;
|
||||
{
|
||||
struct fxp_softc *sc = arg;
|
||||
struct fxp_csr *csr = sc->csr;
|
||||
struct ifnet *ifp = &sc->arpcom.ac_if;
|
||||
int found = 0;
|
||||
u_char statack;
|
||||
|
||||
while ((statack = csr->scb_statack) != 0) {
|
||||
found = 1;
|
||||
/*
|
||||
* First ACK all the interrupts in this pass.
|
||||
*/
|
||||
@ -653,8 +651,6 @@ rcvloop:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -21,7 +21,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: if_pdq.c,v 1.11 1995/12/07 12:47:37 davidg Exp $
|
||||
* $Id: if_pdq.c,v 1.12 1995/12/16 00:27:42 bde Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -473,13 +473,21 @@ pdq_pci_ifwatchdog(struct ifnet *ifp)
|
||||
pdq_ifwatchdog(PDQ_PCI_UNIT_TO_SOFTC(ifp->if_unit));
|
||||
}
|
||||
|
||||
static int
|
||||
static
|
||||
#ifdef __FreeBSD__
|
||||
void
|
||||
#else
|
||||
int
|
||||
#endif
|
||||
pdq_pci_ifintr(
|
||||
void *vsc)
|
||||
{
|
||||
pdq_softc_t *sc = vsc;
|
||||
|
||||
return pdq_interrupt(sc->sc_pdq);
|
||||
#ifndef __FreeBSD__
|
||||
return
|
||||
#endif
|
||||
pdq_interrupt(sc->sc_pdq);
|
||||
}
|
||||
|
||||
static char *
|
||||
|
@ -127,7 +127,7 @@
|
||||
#include <machine/ioctl_meteor.h>
|
||||
|
||||
|
||||
static int meteor_intr __P((void *arg));
|
||||
static void meteor_intr __P((void *arg));
|
||||
|
||||
/*
|
||||
* Allocate enough memory for:
|
||||
@ -548,7 +548,7 @@ met_probe (pcici_t tag, pcidi_t type)
|
||||
/* interrupt handling routine
|
||||
complete meteor_read() if using interrupts
|
||||
*/
|
||||
static int
|
||||
static void
|
||||
meteor_intr(void *arg)
|
||||
{
|
||||
meteor_reg_t *mtr = (meteor_reg_t *) arg;
|
||||
@ -737,7 +737,6 @@ meteor_intr(void *arg)
|
||||
}
|
||||
|
||||
*stat |= 0x7; /* clear interrupt status */
|
||||
return(1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** $Id: ncr.c,v 1.59 1996/01/15 23:51:10 se Exp $
|
||||
** $Id: ncr.c,v 1.60 1996/01/18 19:59:23 se Exp $
|
||||
**
|
||||
** Device driver for the NCR 53C810 PCI-SCSI-Controller.
|
||||
**
|
||||
@ -1202,7 +1202,7 @@ static void ncr_getclock (ncb_p np);
|
||||
static ccb_p ncr_get_ccb (ncb_p np, u_long flags, u_long t,u_long l);
|
||||
static U_INT32 ncr_info (int unit);
|
||||
static void ncr_init (ncb_p np, char * msg, u_long code);
|
||||
static int ncr_intr (void *vnp);
|
||||
static void ncr_intr (void *vnp);
|
||||
static void ncr_int_ma (ncb_p np);
|
||||
static void ncr_int_sir (ncb_p np);
|
||||
static void ncr_int_sto (ncb_p np);
|
||||
@ -1249,7 +1249,7 @@ static void ncr_attach (pcici_t tag, int unit);
|
||||
|
||||
|
||||
static char ident[] =
|
||||
"\n$Id: ncr.c,v 1.59 1996/01/15 23:51:10 se Exp $\n";
|
||||
"\n$Id: ncr.c,v 1.60 1996/01/18 19:59:23 se Exp $\n";
|
||||
|
||||
static u_long ncr_version = NCR_VERSION * 11
|
||||
+ (u_long) sizeof (struct ncb) * 7
|
||||
@ -3496,12 +3496,11 @@ static void ncr_attach (pcici_t config_id, int unit)
|
||||
**==========================================================
|
||||
*/
|
||||
|
||||
static int
|
||||
static void
|
||||
ncr_intr(vnp)
|
||||
void *vnp;
|
||||
{
|
||||
ncb_p np = vnp;
|
||||
int n = 0;
|
||||
int oldspl = splbio();
|
||||
|
||||
if (DEBUG_FLAGS & DEBUG_TINY) printf ("[");
|
||||
@ -3514,14 +3513,12 @@ ncr_intr(vnp)
|
||||
ncr_exception (np);
|
||||
} while (INB(nc_istat) & (INTF|SIP|DIP));
|
||||
|
||||
n=1;
|
||||
np->ticks = 100;
|
||||
};
|
||||
|
||||
if (DEBUG_FLAGS & DEBUG_TINY) printf ("]\n");
|
||||
|
||||
splx (oldspl);
|
||||
return (n);
|
||||
}
|
||||
|
||||
/*==========================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** $Id: pci.c,v 1.39 1995/12/16 00:27:46 bde Exp $
|
||||
** $Id: pci.c,v 1.40 1996/01/19 19:01:19 se Exp $
|
||||
**
|
||||
** General subroutines for the PCI bus.
|
||||
** pci_configure ()
|
||||
@ -1149,38 +1149,23 @@ static void
|
||||
pci_int (int irq)
|
||||
{
|
||||
struct pci_int_desc * p;
|
||||
int c, s;
|
||||
#ifdef PCI_EDGE_INT
|
||||
int i, n;
|
||||
#endif
|
||||
int s;
|
||||
|
||||
if (irq<0 || irq >= PCI_MAX_IRQ) {
|
||||
printf ("pci_int: irq %d out of range, ignored\n", irq);
|
||||
return;
|
||||
};
|
||||
|
||||
#ifdef PCI_EDGE_INT
|
||||
for (i=0; i<1000; i++) {
|
||||
n = 0;
|
||||
#endif
|
||||
for (p = pci_int_desc[irq]; p!=NULL; p=p->pcid_next) {
|
||||
s = splq (*p->pcid_maskptr);
|
||||
c= (*p->pcid_handler) (p->pcid_argument);
|
||||
p-> pcid_tally += c;
|
||||
splx (s);
|
||||
#ifdef PCI_EDGE_INT
|
||||
n += c;
|
||||
#endif
|
||||
for (p = pci_int_desc[irq]; p!=NULL; p=p->pcid_next) {
|
||||
s = splq (*p->pcid_maskptr);
|
||||
(*p->pcid_handler) (p->pcid_argument);
|
||||
p-> pcid_tally++;
|
||||
splx (s);
|
||||
#if 0
|
||||
if (c && p->pcid_tally<20)
|
||||
if (p->pcid_tally<20)
|
||||
printf ("PCI_INT: irq=%d h=%p cpl o=%x n=%x val=%d\n",
|
||||
irq, p->pcid_handler, s, cpl, c);
|
||||
irq, p->pcid_handler, s, cpl, c);
|
||||
#endif
|
||||
};
|
||||
#ifdef PCI_EDGE_INT
|
||||
if (!n) return;
|
||||
};
|
||||
printf ("pci_int(%d): permanent interrupt request.\n", irq);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** $Id: pcivar.h,v 1.6 1995/05/30 08:13:12 rgrimes Exp $
|
||||
** $Id: pcivar.h,v 1.7 1995/11/21 12:54:55 bde Exp $
|
||||
**
|
||||
** Declarations for pci device drivers.
|
||||
**
|
||||
@ -228,17 +228,10 @@ int pci_map_port (pcici_t tag, u_long entry, u_short * pa);
|
||||
**
|
||||
** Supports multiple handlers per irq (shared interrupts).
|
||||
**
|
||||
** -----------------
|
||||
**
|
||||
** There is code to support shared edge triggered ints.
|
||||
** This relies on the cooperation of the interrupt handlers:
|
||||
** they have to return a value <>0 if and only if something
|
||||
** was done. Beware of the performance penalty.
|
||||
**
|
||||
**-----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
typedef int pci_inthand_t(void *arg);
|
||||
typedef void pci_inthand_t(void *arg);
|
||||
|
||||
struct pci_int_desc {
|
||||
struct pci_int_desc * pcid_next;
|
||||
|
Loading…
x
Reference in New Issue
Block a user