PERFORCE change 102753 for review
John Birrell
jb at FreeBSD.org
Sun Jul 30 00:07:15 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=102753
Change 102753 by jb at 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;
More information about the p4-projects
mailing list