Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/dev/ic Pullup from trunk: 1.13



details:   https://anonhg.NetBSD.org/src/rev/60ce916008f3
branches:  netbsd-1-5
changeset: 488648:60ce916008f3
user:      scw <scw%NetBSD.org@localhost>
date:      Sat Jul 22 15:28:19 2000 +0000

description:
Pullup from trunk: 1.13
Approved by: thorpej

Make use of generic soft interrupts, when available.

diffstat:

 sys/dev/ic/clmpcc.c |  28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)

diffs (90 lines):

diff -r 8e15cc47f040 -r 60ce916008f3 sys/dev/ic/clmpcc.c
--- a/sys/dev/ic/clmpcc.c       Sat Jul 22 05:06:28 2000 +0000
+++ b/sys/dev/ic/clmpcc.c       Sat Jul 22 15:28:19 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clmpcc.c,v 1.10 2000/03/19 10:38:43 scw Exp $ */
+/*     $NetBSD: clmpcc.c,v 1.10.4.1 2000/07/22 15:28:19 scw Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -59,6 +59,7 @@
 #include <sys/malloc.h>
 
 #include <machine/bus.h>
+#include <machine/intr.h>
 #include <machine/param.h>
 
 #include <dev/ic/clmpccreg.h>
@@ -298,7 +299,16 @@
        printf(": Cirrus Logic CD240%c Serial Controller\n",
                (clmpcc_rd_msvr(sc) & CLMPCC_MSVR_PORT_ID) ? '0' : '1');
 
+#ifndef __GENERIC_SOFT_INTERRUPTS
        sc->sc_soft_running = 0;
+#else
+       sc->sc_softintr_cookie =
+           softintr_establish(IPL_SOFTSERIAL, clmpcc_softintr, sc);
+#ifdef DEBUG
+       if (sc->sc_softintr_cookie == NULL)
+               panic("clmpcc_attach: softintr_establish");
+#endif
+#endif
        memset(&(sc->sc_chans[0]), 0, sizeof(sc->sc_chans));
 
        for (chan = 0; chan < CLMPCC_NUM_CHANS; chan++) {
@@ -1218,10 +1228,14 @@
                clmpcc_wrreg(sc, CLMPCC_REG_REOIR, 0);
                if ( sc->sc_soft_running == 0 ) {
                        sc->sc_soft_running = 1;
+#ifndef __GENERIC_SOFT_INTERRUPTS
                        (sc->sc_softhook)(sc);
                }
        } else
                clmpcc_wrreg(sc, CLMPCC_REG_REOIR, CLMPCC_REOIR_NO_TRANS);
+#else
+               softintr_schedule(sc->sc_softintr_cookie);
+#endif
 
 #ifdef DDB
        /*
@@ -1339,10 +1353,14 @@
                 * Request Tx processing in the soft interrupt handler
                 */
                ch->ch_tx_done = 1;
-               if ( ! sc->sc_soft_running ) {
+#ifndef __GENERIC_SOFT_INTERRUPTS
+               if ( sc->sc_soft_running == 0 ) {
                        sc->sc_soft_running = 1;
                        (sc->sc_softhook)(sc);
                }
+#else
+               softintr_schedule(sc->sc_softintr_cookie);
+#endif
        }
 
        clmpcc_wrreg(sc, CLMPCC_REG_IER, tir);
@@ -1380,10 +1398,14 @@
 
        clmpcc_wrreg(sc, CLMPCC_REG_MEOIR, 0);
 
+#ifndef __GENERIC_SOFT_INTERRUPTS
        if ( sc->sc_soft_running == 0 ) {
                sc->sc_soft_running = 1;
                (sc->sc_softhook)(sc);
        }
+#else
+       softintr_schedule(sc->sc_softintr_cookie);
+#endif
 
        return 1;
 }
@@ -1401,7 +1423,9 @@
        u_int c;
        int chan;
 
+#ifndef __GENERIC_SOFT_INTERRUPTS
        sc->sc_soft_running = 0;
+#endif
 
        /* Handle Modem state changes too... */
 



Home | Main Index | Thread Index | Old Index