Use hb_intr_establish().

This commit is contained in:
tsubai 1999-12-17 03:21:10 +00:00
parent 8a2b8d9a8b
commit 9df2e626d6
4 changed files with 43 additions and 86 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_le.c,v 1.3 1998/07/21 17:36:03 drochner Exp $ */
/* $NetBSD: if_le.c,v 1.4 1999/12/17 03:21:12 tsubai Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -223,18 +223,13 @@ le_attach(parent, self, aux)
sc->sc_hwinit = NULL;
am7990_config(&lesc->sc_am7990);
}
int
leintr(unit)
int unit;
{
struct am7990_softc *sc;
extern struct cfdriver le_cd;
if (unit >= le_cd.cd_ndevs)
return 0;
sc = le_cd.cd_devs[unit];
return am7990_intr(sc);
switch (sc->sc_dev.dv_unit) {
case 0:
hb_intr_establish(1, IPL_NET, am7990_intr, sc);
break;
default:
hb_intr_establish(0, IPL_NET, am7990_intr, sc);
break;
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sc_wrap.c,v 1.11 1999/09/30 23:01:12 thorpej Exp $ */
/* $NetBSD: sc_wrap.c,v 1.12 1999/12/17 03:21:12 tsubai Exp $ */
/*
* This driver is slow! Need to rewrite.
@ -49,6 +49,7 @@ extern int scintr __P((void));
extern void scsi_hardreset __P((void));
extern int sc_busy __P((struct sc_softc *, int));
extern paddr_t kvtophys __P((vaddr_t));
extern int dma_intr __P((void *));
static int sc_disconnect = IDT_DISCON;
@ -113,6 +114,8 @@ cxd1185_attach(parent, self, aux)
DELAY(100000);
printf("\n");
hb_intr_establish(0, IPL_BIO, dma_intr, sc);
config_found(&sc->sc_dev, &sc->sc_link, scsiprint);
}
@ -349,10 +352,13 @@ sc_done(scb)
xs->status = 0;
if (scb->istatus != INST_EP) {
if (! cold)
if (scb->istatus == INST_EP|INST_TO)
xs->error = XS_SELTIMEOUT;
else {
printf("SC(i): [istatus=0x%x, tstatus=0x%x]\n",
scb->istatus, scb->tstatus);
xs->error = XS_DRIVER_STUFFUP;
xs->error = XS_DRIVER_STUFFUP;
}
}
switch (scb->tstatus) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs.c,v 1.7 1999/03/27 01:21:36 wrstuden Exp $ */
/* $NetBSD: zs.c,v 1.8 1999/12/17 03:21:12 tsubai Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -173,7 +173,7 @@ struct cfattach zsc_ca = {
extern struct cfdriver zsc_cd;
static void zshard __P((void *));
static int zshard __P((void *));
static void zssoft __P((void *));
static int zs_get_speed __P((struct zs_chanstate *));
@ -297,10 +297,8 @@ zs_attach(parent, self, aux)
*/
if (!didintr) {
didintr = 1;
#if 0
isr_add_autovect(zssoft, NULL, ZSSOFT_PRI);
isr_add_autovect(zshard, NULL, ca->ca_intpri);
#endif
hb_intr_establish(1, IPL_SERIAL, zshard, NULL);
}
/* XXX; evcnt_attach() ? */
@ -339,13 +337,15 @@ static volatile int zssoftpending;
* Our ZS chips all share a common, autovectored interrupt,
* so we have to look at all of them on each interrupt.
*/
static void
static int
zshard(arg)
void *arg;
{
register struct zsc_softc *zsc;
register int unit, rval, softreq;
(void) *(volatile u_char *)SCCVECT;
rval = softreq = 0;
for (unit = 0; unit < zsc_cd.cd_ndevs; unit++) {
zsc = zsc_cd.cd_devs[unit];
@ -361,7 +361,7 @@ zshard(arg)
zssoftpending = 1;
zssoft(arg); /*isr_soft_request(ZSSOFT_PRI);*/
}
return;
return rval;
}
/*
@ -670,15 +670,3 @@ zscnpollc(dev, on)
int on;
{
}
/*
* ZS vector interrupt service routine.
*/
void
zs_intr()
{
int vec;
vec = *(volatile u_char *)SCCVECT;
zshard((void *)vec); /* XXX vec is not used */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: newsmips_trap.c,v 1.6 1999/10/17 15:06:46 tsubai Exp $ */
/* $NetBSD: newsmips_trap.c,v 1.7 1999/12/17 03:21:10 tsubai Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -63,7 +63,7 @@
#include <newsmips/dev/scc.h>
#include "le.h"
#include "sc.h"
#include "kb.h"
#include "ms.h"
/*#include "lp.h"*/
@ -75,13 +75,11 @@ void level0_intr __P((void));
void level1_intr __P((void));
void dma_intr __P((void));
void print_int_stat __P((char *));
void exec_hb_intr2 __P((void));
void exec_hb_intr4 __P((void));
void news3400_errintr __P((u_int));
extern int leintr __P((int));
extern int sc_intr __P((void));
extern void kbm_rint __P((int));
int sc_intr __P((void));
void kbm_rint __P((int));
void hb_intr_dispatch __P((int));
static int badaddr_flag;
@ -185,25 +183,12 @@ level0_intr()
stat = *(volatile u_char *)INTST1 & LEVEL0_MASK;
*(u_char *)INTCLR1 = stat;
if (stat & INTST1_DMA)
dma_intr();
if (stat & INTST1_SLOT1) {
hb_intr_dispatch(0);
if (stat & INTST1_SLOT1)
intrcnt[SLOT1_INTR]++;
exec_hb_intr2();
}
#if NLE > 0
if (stat & INTST1_SLOT3) {
int s, t;
s = splimp();
t = leintr(1);
splx(s);
if (t == 0)
exec_hb_intr4();
if (stat & INTST1_SLOT3)
intrcnt[SLOT3_INTR]++;
}
#endif
if (stat & INTST1_EXT1)
print_int_stat("EXT #1");
if (stat & INTST1_EXT3)
@ -240,21 +225,13 @@ level1_intr()
*(volatile u_char *)INTCLR1 = INTCLR1_BEEP;
print_int_stat("BEEP");
}
if (stat & INTST1_SCC) {
extern void zs_intr();
if (stat & INTST1_SCC)
intrcnt[SERIAL0_INTR]++;
zs_intr();
if (saved_inten1 & *(u_char *)INTST1 & INTST1_SCC)
zs_intr();
}
#if NLE > 0
if (stat & INTST1_LANCE) {
if (stat & INTST1_LANCE)
intrcnt[LANCE_INTR]++;
leintr(0);
}
#endif
hb_intr_dispatch(1);
*(u_char *)INTEN1 = saved_inten1;
@ -289,6 +266,7 @@ level1_intr()
/*
* DMA interrupt service routine.
* XXX only SCSI works now.
*/
void
dma_intr()
@ -312,9 +290,11 @@ dma_intr()
printf("dma_intr: MRQ\n");
}
#if NSC > 0
/* SCSI Dispatch */
if (gstat & CH_INT(CH_SCSI))
sc_intr();
#endif
#if NFD > 0
/* FDC Interrupt Dispatch */
@ -346,18 +326,6 @@ print_int_stat(msg)
printf("INTST0=0x%x, INTST1=0x%x.\n", s0, s1);
}
void
exec_hb_intr2()
{
printf("stray hb interrupt level 2\n");
}
void
exec_hb_intr4()
{
printf("stray hb interrupt level 4\n");
}
int
news3400_badaddr(addr, size)
void *addr;