From owner-p4-projects@FreeBSD.ORG Sun Jun 12 22:55:11 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3508916A420; Sun, 12 Jun 2005 22:55:11 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EDB2116A41C for ; Sun, 12 Jun 2005 22:55:10 +0000 (GMT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C6F4043D49 for ; Sun, 12 Jun 2005 22:55:10 +0000 (GMT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5CMtARM020879 for ; Sun, 12 Jun 2005 22:55:10 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5CMtAiq020876 for perforce@freebsd.org; Sun, 12 Jun 2005 22:55:10 GMT (envelope-from marcel@freebsd.org) Date: Sun, 12 Jun 2005 22:55:10 GMT Message-Id: <200506122255.j5CMtAiq020876@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Cc: Subject: PERFORCE change 78472 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: Sun, 12 Jun 2005 22:55:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=78472 Change 78472 by marcel@marcel_nfs on 2005/06/12 22:54:54 Mute the low-level console when the VT has been wired up. Only allow low-level console output for debugger output. Affected files ... .. //depot/projects/tty/sys/dev/vtc/vtc_con.c#10 edit .. //depot/projects/tty/sys/dev/vtc/vtc_core.c#9 edit Differences ... ==== //depot/projects/tty/sys/dev/vtc/vtc_con.c#10 (text+ko) ==== @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -46,8 +47,9 @@ static cn_putc_t vtc_cnputc; static cn_term_t vtc_cnterm; -static int cncol = 0; -static int cnrow = 0; +static int vtc_cncol = 0; +static int vtc_cnrow = 0; +static int vtc_cnmute = 0; CONS_DRIVER(vtc, vtc_cnprobe, vtc_cninit, vtc_cnterm, vtc_cngetc, vtc_cncheckc, vtc_cnputc, NULL); @@ -98,28 +100,32 @@ if (c <= 0 || c >= 0x7f) return; + /* Allow low-level console output to be surpressed. */ + if (vtc_cnmute && !kdb_active) + return; + width = vc->vtc_con_width; switch (c) { case 8: /* BS */ - if (cncol > 0) - cncol--; + if (vtc_cncol > 0) + vtc_cncol--; ch = ' '; break; case 9: /* HT */ - cncol = (cncol + 7) & 7; - if (cncol >= 80) - cncol = 79; + vtc_cncol = (vtc_cncol + 7) & 7; + if (vtc_cncol >= 80) + vtc_cncol = 79; ch = 0; break; case 10: /* LF */ case 11: /* VT (processed as LF) */ case 12: /* FF (processed as LF) */ - cncol = 0; - cnrow++; + vtc_cncol = 0; + vtc_cnrow++; ch = 0; break; case 13: /* CR */ - cncol = 0; + vtc_cncol = 0; ch = 0; break; default: @@ -130,21 +136,21 @@ if (ch != 0) { glyph = vtc_font_8x16 + ((ch - ' ') * 16); vc->vtc_con_bitblt(vc, BITBLT_H1TOFB, (uintptr_t)glyph, - width * cnrow * 16 + cncol * 8, 8, 16, 0, 7); + width * vtc_cnrow * 16 + vtc_cncol * 8, 8, 16, 0, 7); if (c != 8) - cncol++; + vtc_cncol++; } - if (cncol >= 80) { - cncol = 0; - cnrow++; + if (vtc_cncol >= 80) { + vtc_cncol = 0; + vtc_cnrow++; } - if (cnrow >= 30) { + if (vtc_cnrow >= 30) { vc->vtc_con_bitblt(vc, BITBLT_FBTOFB, width * 16, 0, width, 29 * 16); vc->vtc_con_bitblt(vc, BITBLT_CTOFB, 0, width * 29 * 16, width, 16); - cnrow = 29; + vtc_cnrow = 29; } } @@ -161,3 +167,12 @@ return (-1); } + +static void +vtc_cnfinalize(void *data __unused) +{ + + /* Shut the low-level console up. */ + vtc_cnmute = 1; +} +SYSINIT(cnfinalize, SI_SUB_VTC, SI_ORDER_ANY, vtc_cnfinalize, NULL) ==== //depot/projects/tty/sys/dev/vtc/vtc_core.c#9 (text+ko) ==== @@ -242,7 +242,7 @@ strcpy(vc->vtc_consdev->cn_name, "ttyV0"); } } -SYSINIT(initial, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, vtc_initial, NULL) +SYSINIT(vtc_initial, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, vtc_initial, NULL) /* * Preempt the low-level console driver with the accelerated driver. @@ -264,7 +264,7 @@ TAILQ_INSERT_TAIL(&te->te_vodevs, vo, vo_tedevs); } } -SYSINIT(finalize, SI_SUB_VTC, SI_ORDER_ANY, vtc_finalize, NULL) +SYSINIT(vtc_finalize, SI_SUB_VTC, SI_ORDER_FIRST, vtc_finalize, NULL) static int vtc_modevent(module_t mod, int type, void *data)