Module Name: src
Committed By: jmcneill
Date: Thu Dec 15 01:04:15 UTC 2011
Modified Files:
src/sys/arch/usermode/dev: ttycons.c
src/sys/arch/usermode/include: thunk.h
src/sys/arch/usermode/usermode: thunk.c
Log Message:
use write instead of putchar putchar putchar putchar putchar ... for console
output
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/usermode/dev/ttycons.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/usermode/include/thunk.h
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/usermode/usermode/thunk.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/usermode/dev/ttycons.c
diff -u src/sys/arch/usermode/dev/ttycons.c:1.11 src/sys/arch/usermode/dev/ttycons.c:1.12
--- src/sys/arch/usermode/dev/ttycons.c:1.11 Mon Dec 12 17:07:42 2011
+++ src/sys/arch/usermode/dev/ttycons.c Thu Dec 15 01:04:15 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ttycons.c,v 1.11 2011/12/12 17:07:42 jmcneill Exp $ */
+/* $NetBSD: ttycons.c,v 1.12 2011/12/15 01:04:15 jmcneill Exp $ */
/*-
* Copyright (c) 2007 Jared D. McNeill <[email protected]>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ttycons.c,v 1.11 2011/12/12 17:07:42 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttycons.c,v 1.12 2011/12/15 01:04:15 jmcneill Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -301,8 +301,8 @@ ttycons_ioctl(dev_t dev, u_long cmd, voi
static void
ttycons_start(struct tty *t)
{
- u_char buf[64+1];
- int s, len, i;
+ u_char buf[80+1];
+ int s, len; //, i;
s = spltty();
if (t->t_state & (TS_TIMEOUT|TS_BUSY|TS_TTSTOP)) {
@@ -313,9 +313,7 @@ ttycons_start(struct tty *t)
splx(s);
len = q_to_b(&t->t_outq, buf, sizeof(buf) - 1);
- for (i = 0; i < len; i++) {
- thunk_putchar(buf[i]);
- }
+ thunk_write(1, buf, len);
s = spltty();
t->t_state &= ~TS_BUSY;
Index: src/sys/arch/usermode/include/thunk.h
diff -u src/sys/arch/usermode/include/thunk.h:1.38 src/sys/arch/usermode/include/thunk.h:1.39
--- src/sys/arch/usermode/include/thunk.h:1.38 Thu Dec 15 00:40:03 2011
+++ src/sys/arch/usermode/include/thunk.h Thu Dec 15 01:04:15 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: thunk.h,v 1.38 2011/12/15 00:40:03 jmcneill Exp $ */
+/* $NetBSD: thunk.h,v 1.39 2011/12/15 01:04:15 jmcneill Exp $ */
/*-
* Copyright (c) 2011 Jared D. McNeill <[email protected]>
@@ -103,6 +103,7 @@ int thunk_open(const char *, int, mode_t
int thunk_fstat_getsize(int, ssize_t *, ssize_t *);
ssize_t thunk_pread(int, void *, size_t, off_t);
ssize_t thunk_pwrite(int, const void *, size_t, off_t);
+ssize_t thunk_write(int, const void *, size_t);
int thunk_fsync(int);
int thunk_mkstemp(char *);
int thunk_unlink(const char *);
Index: src/sys/arch/usermode/usermode/thunk.c
diff -u src/sys/arch/usermode/usermode/thunk.c:1.44 src/sys/arch/usermode/usermode/thunk.c:1.45
--- src/sys/arch/usermode/usermode/thunk.c:1.44 Thu Dec 15 00:40:03 2011
+++ src/sys/arch/usermode/usermode/thunk.c Thu Dec 15 01:04:14 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: thunk.c,v 1.44 2011/12/15 00:40:03 jmcneill Exp $ */
+/* $NetBSD: thunk.c,v 1.45 2011/12/15 01:04:14 jmcneill Exp $ */
/*-
* Copyright (c) 2011 Jared D. McNeill <[email protected]>
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifdef __NetBSD__
-__RCSID("$NetBSD: thunk.c,v 1.44 2011/12/15 00:40:03 jmcneill Exp $");
+__RCSID("$NetBSD: thunk.c,v 1.45 2011/12/15 01:04:14 jmcneill Exp $");
#endif
#include <sys/types.h>
@@ -410,6 +410,12 @@ thunk_pwrite(int d, const void *buf, siz
return pwrite(d, buf, nbytes, offset);
}
+ssize_t
+thunk_write(int d, const void *buf, size_t nbytes)
+{
+ return write(d, buf, nbytes);
+}
+
int
thunk_fsync(int fd)
{