From owner-p4-projects@FreeBSD.ORG Mon Sep 22 18:04:42 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 079BD1065674; Mon, 22 Sep 2008 18:04:42 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE7C61065671 for ; Mon, 22 Sep 2008 18:04:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id AD08C8FC0A for ; Mon, 22 Sep 2008 18:04:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m8MI4fZO088283 for ; Mon, 22 Sep 2008 18:04:41 GMT (envelope-from ed@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m8MI4fU6088251 for perforce@freebsd.org; Mon, 22 Sep 2008 18:04:41 GMT (envelope-from ed@FreeBSD.org) Date: Mon, 22 Sep 2008 18:04:41 GMT Message-Id: <200809221804.m8MI4fU6088251@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ed@FreeBSD.org using -f From: Ed Schouten To: Perforce Change Reviews Cc: Subject: PERFORCE change 150288 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2008 18:04:42 -0000 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) {