Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hpcmips/tx Replace callout(9) with softint(9) which...



details:   https://anonhg.NetBSD.org/src/rev/ebc9e7c5ce17
branches:  trunk
changeset: 756511:ebc9e7c5ce17
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Tue Jul 20 15:03:53 2010 +0000

description:
Replace callout(9) with softint(9) which is more appropriate there.
Inspired by PR port-hpcmips/43472 and tested by Risto Sainio.

diffstat:

 sys/arch/hpcmips/tx/txcom.c |  21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diffs (70 lines):

diff -r 8c8605273296 -r ebc9e7c5ce17 sys/arch/hpcmips/tx/txcom.c
--- a/sys/arch/hpcmips/tx/txcom.c       Tue Jul 20 14:42:03 2010 +0000
+++ b/sys/arch/hpcmips/tx/txcom.c       Tue Jul 20 15:03:53 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: txcom.c,v 1.43 2010/07/16 15:30:10 tsutsui Exp $ */
+/*     $NetBSD: txcom.c,v 1.44 2010/07/20 15:03:53 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: txcom.c,v 1.43 2010/07/16 15:30:10 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: txcom.c,v 1.44 2010/07/20 15:03:53 tsutsui Exp $");
 
 #include "opt_tx39uart_debug.h"
 
@@ -99,8 +99,8 @@
        struct tty              *sc_tty;
        struct txcom_chip       *sc_chip;
 
-       struct callout          sc_txsoft_ch;
-       struct callout          sc_rxsoft_ch;
+       void            *sc_txsoft_cookie;
+       void            *sc_rxsoft_cookie;
 
        u_int8_t        *sc_tba;        /* transmit buffer address */
        int             sc_tbc;         /* transmit byte count */
@@ -249,10 +249,6 @@
 
        printf("\n");
 
-       /* initialize callouts */
-       callout_init(&sc->sc_txsoft_ch, 0);
-       callout_init(&sc->sc_rxsoft_ch, 0);
-
        /* 
         * Enable interrupt
         */
@@ -273,6 +269,11 @@
        tx_intr_establish(tc, TXCOMINTR(BREAK, slot), IST_EDGE, IPL_TTY,
            txcom_break_intr, sc);
 
+       sc->sc_txsoft_cookie =
+           softint_establish(SOFTINT_SERIAL, txcom_txsoft, sc);
+       sc->sc_rxsoft_cookie =
+           softint_establish(SOFTINT_SERIAL, txcom_rxsoft, sc);
+
        /*
         * UARTA has external signal line. (its wiring is platform dependent)
         */
@@ -700,7 +701,7 @@
        sc->sc_rbuf[sc->sc_rbput] = c;
        sc->sc_rbput = (sc->sc_rbput + 1) % TXCOM_RING_MASK;
        
-       callout_reset(&sc->sc_rxsoft_ch, 1, txcom_rxsoft, sc);
+       softint_schedule(sc->sc_rxsoft_cookie);
 
        return 0;
 }
@@ -749,7 +750,7 @@
                sc->sc_tbc--;
                sc->sc_tba++;
        } else {
-               callout_reset(&sc->sc_txsoft_ch, 1, txcom_txsoft, sc);
+               softint_schedule(sc->sc_txsoft_cookie);
        }
 
        return 0;



Home | Main Index | Thread Index | Old Index