PERFORCE change 150288 for review
Ed Schouten
ed at FreeBSD.org
Mon Sep 22 18:04:42 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=150288
Change 150288 by ed at 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)
{
More information about the p4-projects
mailing list