From owner-p4-projects@FreeBSD.ORG Mon Dec 31 07:22:55 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ED35416A513; Mon, 31 Dec 2007 07:22:54 +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 6639716A41A for ; Mon, 31 Dec 2007 07:22:54 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 5667313C44B for ; Mon, 31 Dec 2007 07:22:54 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lBV7MsT2035124 for ; Mon, 31 Dec 2007 07:22:54 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lBV7MsTa035120 for perforce@freebsd.org; Mon, 31 Dec 2007 07:22:54 GMT (envelope-from kmacy@freebsd.org) Date: Mon, 31 Dec 2007 07:22:54 GMT Message-Id: <200712310722.lBV7MsTa035120@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 132160 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, 31 Dec 2007 07:22:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=132160 Change 132160 by kmacy@pandemonium:kmacy:xen31 on 2007/12/31 07:22:44 make console input polling work for the first time ever so that ddb and the mountroot prompt will behave correctly Affected files ... .. //depot/projects/xen31/sys/dev/xen/console/console.c#4 edit .. //depot/projects/xen31/sys/dev/xen/console/xencons_ring.c#4 edit .. //depot/projects/xen31/sys/dev/xen/console/xencons_ring.h#2 edit Differences ... ==== //depot/projects/xen31/sys/dev/xen/console/console.c#4 (text+ko) ==== @@ -146,6 +146,9 @@ xccncheckc(struct consdev *dev) { int ret = (xc_mute ? 0 : -1); + if (xencons_has_input()) + xencons_handle_input(NULL); + CN_LOCK(cn_mtx); if ((rp - rc)) { /* we need to return only one char */ ==== //depot/projects/xen31/sys/dev/xen/console/xencons_ring.c#4 (text+ko) ==== @@ -33,6 +33,18 @@ return (struct xencons_interface *)console_page; } + +int +xencons_has_input(void) +{ + struct xencons_interface *intf; + + intf = xencons_interface(); + + return (intf->in_cons != intf->in_prod); +} + + int xencons_ring_send(const char *data, unsigned len) { @@ -63,8 +75,8 @@ static xencons_receiver_func *xencons_receiver; -static void -handle_input(void *unused) +void +xencons_handle_input(void *unused) { struct xencons_interface *intf; XENCONS_RING_IDX cons, prod; @@ -74,6 +86,7 @@ cons = intf->in_cons; prod = intf->in_prod; + /* XXX needs locking */ while (cons != prod) { xencons_rx(intf->in + MASK_XENCONS_IDX(cons, intf->in), 1); cons++; @@ -102,7 +115,7 @@ return 0; err = bind_caller_port_to_irqhandler(xen_start_info->console_evtchn, - "xencons", handle_input, NULL, + "xencons", xencons_handle_input, NULL, INTR_TYPE_MISC | INTR_MPSAFE, NULL); if (err) { XENPRINTF("XEN console request irq failed %i\n", err); ==== //depot/projects/xen31/sys/dev/xen/console/xencons_ring.h#2 (text+ko) ==== @@ -10,4 +10,7 @@ typedef void (xencons_receiver_func)(char *buf, unsigned len); void xencons_ring_register_receiver(xencons_receiver_func *f); +void xencons_handle_input(void *unused); +int xencons_has_input(void); + #endif /* _XENCONS_RING_H */