Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Sep 2008 18:04:41 GMT
From:      Ed Schouten <ed@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 150288 for review
Message-ID:  <200809221804.m8MI4fU6088251@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=150288

Change 150288 by ed@ed_dull on 2008/09/22 18:03:43

	Add a rint_done() hook.
	
	Requested by: thompsa

Affected files ...

.. //depot/projects/mpsafetty/sys/kern/tty_ttydisc.c#24 edit
.. //depot/projects/mpsafetty/sys/sys/ttyhook.h#8 edit

Differences ...

==== //depot/projects/mpsafetty/sys/kern/tty_ttydisc.c#24 (text+ko) ====

@@ -1069,6 +1069,9 @@
 
 	tty_lock_assert(tp, MA_OWNED);
 
+	if (ttyhook_hashook(tp, rint_done))
+		ttyhook_rint_done(tp);
+
 	/* Wake up readers. */
 	tty_wakeup(tp, FREAD);
 	/* Wake up driver for echo. */

==== //depot/projects/mpsafetty/sys/sys/ttyhook.h#8 (text+ko) ====

@@ -42,6 +42,7 @@
 
 typedef int th_rint_t(struct tty *tp, char c, int flags);
 typedef size_t th_rint_bypass_t(struct tty *tp, const void *buf, size_t len);
+typedef void th_rint_done_t(struct tty *tp);
 typedef size_t th_rint_poll_t(struct tty *tp);
 
 typedef size_t th_getc_inject_t(struct tty *tp, void *buf, size_t len);
@@ -54,6 +55,7 @@
 	/* Character input. */
 	th_rint_t		*th_rint;
 	th_rint_bypass_t	*th_rint_bypass;
+	th_rint_done_t		*th_rint_done;
 	th_rint_poll_t		*th_rint_poll;
 
 	/* Character output. */
@@ -89,6 +91,15 @@
 	return tp->t_hook->th_rint_bypass(tp, buf, len);
 }
 
+static __inline void
+ttyhook_rint_done(struct tty *tp)
+{
+	tty_lock_assert(tp, MA_OWNED);
+	MPASS(!tty_gone(tp));
+
+	tp->t_hook->th_rint_done(tp);
+}
+
 static __inline size_t
 ttyhook_rint_poll(struct tty *tp)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809221804.m8MI4fU6088251>