From owner-svn-src-user@FreeBSD.ORG Mon Dec 15 15:41:29 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07C3A106564A; Mon, 15 Dec 2008 15:41:29 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6E758FC2C; Mon, 15 Dec 2008 15:41:28 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBFFfSVS099102; Mon, 15 Dec 2008 15:41:28 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBFFfSqJ099101; Mon, 15 Dec 2008 15:41:28 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200812151541.mBFFfSqJ099101@svn.freebsd.org> From: Doug Rabson Date: Mon, 15 Dec 2008 15:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186129 - user/dfr/xenhvm/6/sys/dev/xen/console X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2008 15:41:29 -0000 Author: dfr Date: Mon Dec 15 15:41:28 2008 New Revision: 186129 URL: http://svn.freebsd.org/changeset/base/186129 Log: Make console input work when in DDB. Modified: user/dfr/xenhvm/6/sys/dev/xen/console/console.c Modified: user/dfr/xenhvm/6/sys/dev/xen/console/console.c ============================================================================== --- user/dfr/xenhvm/6/sys/dev/xen/console/console.c Mon Dec 15 15:31:10 2008 (r186128) +++ user/dfr/xenhvm/6/sys/dev/xen/console/console.c Mon Dec 15 15:41:28 2008 (r186129) @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -140,12 +141,17 @@ xccngetc(struct consdev *dev) return 0; do { if ((c = xccncheckc(dev)) == -1) { - /* polling without sleeping in Xen doesn't work well. - * Sleeping gives other things like clock a chance to - * run - */ - tsleep(&cn_mtx, PWAIT | PCATCH, "console sleep", - XC_POLLTIME); +#ifdef KDB + if (!kdb_active) +#endif + /* + * Polling without sleeping in Xen + * doesn't work well. Sleeping gives + * other things like clock a chance to + * run + */ + tsleep(&cn_mtx, PWAIT | PCATCH, + "console sleep", XC_POLLTIME); } } while(c == -1); return c; @@ -155,11 +161,13 @@ int xccncheckc(struct consdev *dev) { int ret = (xc_mute ? 0 : -1); - if (xencons_has_input()) - xencons_handle_input(NULL); + + if (xencons_has_input()) + xencons_handle_input(NULL); CN_LOCK(cn_mtx); if ((rp - rc)) { + if (kdb_active) printf("%s:%d\n", __func__, __LINE__); /* we need to return only one char */ ret = (int)rbuf[RBUF_MASK(rc)]; rc++; @@ -295,7 +303,11 @@ xencons_rx(char *buf, unsigned len) HYPERVISOR_shared_info->evtchn_mask[0]); #endif for (i = 0; i < len; i++) { - if (xen_console_up) + if (xen_console_up +#ifdef DDB + && !kdb_active +#endif + ) (*linesw[tp->t_line]->l_rint)(buf[i], tp); else rbuf[RBUF_MASK(rp++)] = buf[i]; @@ -549,12 +561,3 @@ xcons_force_flush(void) } DRIVER_MODULE(xc, nexus, xc_driver, xc_devclass, 0, 0); -/* - * Local variables: - * mode: C - * c-set-style: "BSD" - * c-basic-offset: 8 - * tab-width: 4 - * indent-tabs-mode: t - * End: - */