Module Name:    src
Committed By:   tsutsui
Date:           Tue Jul 20 15:03:53 UTC 2010

Modified Files:
        src/sys/arch/hpcmips/tx: txcom.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/hpcmips/tx/txcom.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hpcmips/tx/txcom.c
diff -u src/sys/arch/hpcmips/tx/txcom.c:1.43 src/sys/arch/hpcmips/tx/txcom.c:1.44
--- src/sys/arch/hpcmips/tx/txcom.c:1.43	Fri Jul 16 15:30:10 2010
+++ src/sys/arch/hpcmips/tx/txcom.c	Tue Jul 20 15:03:53 2010
@@ -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;

Reply via email to