summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-05-25 07:43:47 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-05-25 07:43:47 +0000
commit7cefd14e67d98e1f8013c82663d28dbd33e9ce7e (patch)
tree9c0429f5216735a140546a7cd6b6d5b64783254b /sys/arch
parent195394ca0fd77eaf853201a38a23a40bfb1d4e91 (diff)
Schedule a soft interrupt, not a timeout, in the hard rx interrupt handler.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/arm/footbridge/footbridge_com.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/sys/arch/arm/footbridge/footbridge_com.c b/sys/arch/arm/footbridge/footbridge_com.c
index f55c0020535..f799b6bb676 100644
--- a/sys/arch/arm/footbridge/footbridge_com.c
+++ b/sys/arch/arm/footbridge/footbridge_com.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: footbridge_com.c,v 1.4 2004/08/17 19:40:45 drahn Exp $ */
+/* $OpenBSD: footbridge_com.c,v 1.5 2005/05/25 07:43:46 miod Exp $ */
/* $NetBSD: footbridge_com.c,v 1.13 2003/03/23 14:12:25 chris Exp $ */
/*-
@@ -78,7 +78,7 @@ struct fcom_softc {
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
void *sc_ih;
- struct timeout sc_softintr_ch;
+ void *sc_si;
int sc_rx_irq;
int sc_tx_irq;
int sc_hwflags;
@@ -103,12 +103,7 @@ static void fcom_softintr (void *);
static int fcom_rxintr (void *);
/*static int fcom_txintr (void *);*/
-/*struct consdev;*/
-/*void fcomcnprobe (struct consdev *);
-void fcomcninit (struct consdev *);*/
-int fcomcngetc (dev_t);
-void fcomcnputc (dev_t, int);
-void fcomcnpollc (dev_t, int);
+cons_decl(fcom);
struct cfattach fcom_ca = {
sizeof (struct fcom_softc), fcom_probe, fcom_attach
@@ -197,7 +192,9 @@ fcom_attach(parent, self, aux)
/* Set up the softc */
sc->sc_iot = fba->fba_fca.fca_iot;
sc->sc_ioh = fba->fba_fca.fca_ioh;
- timeout_set(&sc->sc_softintr_ch, fcom_softintr, sc);
+ sc->sc_si = softintr_establish(IPL_TTY, fcom_softintr, sc);
+ if (sc->sc_si == NULL)
+ panic(": can't establish soft interrupt");
sc->sc_rx_irq = fba->fba_fca.fca_rx_irq;
sc->sc_tx_irq = fba->fba_fca.fca_tx_irq;
sc->sc_hwflags = 0;
@@ -568,8 +565,6 @@ fcomparam(tp, t)
return (0);
}
-static int softint_scheduled = 0;
-
static void
fcom_softintr(arg)
void *arg;
@@ -591,7 +586,6 @@ fcom_softintr(arg)
for (loop = 0; loop < len; ++loop)
(*linesw[tp->t_line].l_rint)(ptr[loop], tp);
- softint_scheduled = 0;
}
#if 0
@@ -616,6 +610,7 @@ fcom_rxintr(arg)
struct tty *tp = sc->sc_tty;
int status;
int byte;
+ int softint_scheduled = 0;
do {
status = bus_space_read_4(iot, ioh, UART_FLAGS);
@@ -635,7 +630,7 @@ fcom_rxintr(arg)
sc->sc_rxbuf[sc->sc_rxpos++] = byte;
if (!softint_scheduled) {
softint_scheduled = 1;
- timeout_add(&sc->sc_softintr_ch, 1);
+ softintr_schedule(sc->sc_si);
}
}
} while (1);