From owner-p4-projects@FreeBSD.ORG Sun Jul 30 00:07:15 2006 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 3FC5E16A4DF; Sun, 30 Jul 2006 00:07:15 +0000 (UTC) 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 DF67816A4DA for ; Sun, 30 Jul 2006 00:07:14 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4E4943D53 for ; Sun, 30 Jul 2006 00:07:14 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k6U07EcV071693 for ; Sun, 30 Jul 2006 00:07:14 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6U07E3u071690 for perforce@freebsd.org; Sun, 30 Jul 2006 00:07:14 GMT (envelope-from jb@freebsd.org) Date: Sun, 30 Jul 2006 00:07:14 GMT Message-Id: <200607300007.k6U07E3u071690@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 102753 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, 30 Jul 2006 00:07:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=102753 Change 102753 by jb@jb_freebsd2 on 2006/07/30 00:07:07 Add puts methods to the console devices. These all default to calling the character methods for the time being. Affected files ... .. //depot/projects/dtrace/src/sys/dev/dcons/dcons.h#3 edit .. //depot/projects/dtrace/src/sys/dev/dcons/dcons_os.c#3 edit .. //depot/projects/dtrace/src/sys/dev/ofw/ofw_console.c#4 edit .. //depot/projects/dtrace/src/sys/dev/syscons/syscons.c#4 edit .. //depot/projects/dtrace/src/sys/dev/zs/zs.c#3 edit Differences ... ==== //depot/projects/dtrace/src/sys/dev/dcons/dcons.h#3 (text+ko) ==== @@ -101,6 +101,7 @@ int dcons_checkc(struct dcons_softc *); int dcons_ischar(struct dcons_softc *); void dcons_putc(struct dcons_softc *, int); +void dcons_puts(struct dcons_softc *, char *, int); int dcons_load_buffer(struct dcons_buf *, int, struct dcons_softc *); void dcons_init(struct dcons_buf *, int, struct dcons_softc *); #endif ==== //depot/projects/dtrace/src/sys/dev/dcons/dcons_os.c#3 (text+ko) ==== @@ -174,6 +174,7 @@ static cn_term_t dcons_cnterm; static cn_getc_t dcons_cngetc; static cn_putc_t dcons_cnputc; +static cn_puts_t dcons_cnputs; CONSOLE_DRIVER(dcons); @@ -455,6 +456,17 @@ return (dcons_os_checkc(dc)); } static void +dcons_cnputs(struct consdev *cp, char *p, int num) +{ + int i; + + for (i = 0; i < num; i++) { + if (p[i] == '\n') + dcons_cnputc(cp, '\r'); + dcons_cnputc(cp, p[i] & 0xff); + } +} +static void dcons_cnputc(struct consdev *cp, int c) { struct dcons_softc *dc = (struct dcons_softc *)cp->cn_arg; ==== //depot/projects/dtrace/src/sys/dev/ofw/ofw_console.c#4 (text+ko) ==== @@ -78,6 +78,7 @@ static cn_term_t ofw_cnterm; static cn_getc_t ofw_cngetc; static cn_putc_t ofw_cnputc; +static cn_puts_t ofw_cnputs; CONSOLE_DRIVER(ofw); @@ -289,6 +290,17 @@ } static void +ofw_cnputs(struct consdev *cp, char *p, int num) +{ + int i; + for (i = 0; i < num; i++) { + if (p[i] == '\n') + ofw_cnputc(cp, '\r'); + ofw_cnputc(cp, p[i] & 0xff); + } +} + +static void ofw_cnputc(struct consdev *cp, int c) { char cbuf; ==== //depot/projects/dtrace/src/sys/dev/syscons/syscons.c#4 (text+ko) ==== @@ -222,6 +222,7 @@ static cn_term_t sc_cnterm; static cn_getc_t sc_cngetc; static cn_putc_t sc_cnputc; +static cn_puts_t sc_cnputs; CONSOLE_DRIVER(sc); @@ -1455,6 +1456,18 @@ } static void +sc_cnputs(struct consdev *cd, char *p, int num) +{ + int i; + + for (i = 0; i < num; i++) { + if (p[i] == '\n') + sc_cnputc(cp, '\r'); + sc_cnputc(cd, p[i] & 0xff); + } +} + +static void sc_cnputc(struct consdev *cd, int c) { u_char buf[1]; ==== //depot/projects/dtrace/src/sys/dev/zs/zs.c#3 (text+ko) ==== @@ -130,6 +130,7 @@ static cn_term_t zs_cnterm; static cn_getc_t zs_cngetc; static cn_putc_t zs_cnputc; +static cn_puts_t zs_cnputs; static int zstty_cngetc(struct zstty_softc *sc); static int zstty_cncheckc(struct zstty_softc *sc); @@ -837,6 +838,17 @@ } static void +zs_cnputs(struct consdev *cn, char *p, int num) +{ + int i; + for (i = 0; i < num; i++) { + if (p[i] == '\n') + zs_cnputc(cp, '\r'); + zs_cnputc(cp, p[i] & 0xff); + } +} + +static void zs_cnputc(struct consdev *cn, int c) { struct zstty_softc *sc = zstty_cons;