Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/usermode/dev move the (now 1024 byte) printing buff...
details: https://anonhg.NetBSD.org/src/rev/df6dcf0e9c77
branches: trunk
changeset: 772166:df6dcf0e9c77
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Wed Dec 21 11:53:07 2011 +0000
description:
move the (now 1024 byte) printing buffer off the stack
diffstat:
sys/arch/usermode/dev/ttycons.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diffs (54 lines):
diff -r c55bfb3df81a -r df6dcf0e9c77 sys/arch/usermode/dev/ttycons.c
--- a/sys/arch/usermode/dev/ttycons.c Wed Dec 21 10:02:45 2011 +0000
+++ b/sys/arch/usermode/dev/ttycons.c Wed Dec 21 11:53:07 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ttycons.c,v 1.14 2011/12/21 10:02:45 reinoud Exp $ */
+/* $NetBSD: ttycons.c,v 1.15 2011/12/21 11:53:07 jmcneill Exp $ */
/*-
* Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ttycons.c,v 1.14 2011/12/21 10:02:45 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttycons.c,v 1.15 2011/12/21 11:53:07 jmcneill Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -53,6 +53,7 @@
struct tty *sc_tty;
void *sc_rd_sih;
void *sc_ctrlc_sih;
+ u_char sc_buf[1024];
};
dev_type_cngetc(ttycons_cngetc);
@@ -129,6 +130,7 @@
tty_attach(sc->sc_tty);
sc->sc_tty->t_oproc = ttycons_start;
sc->sc_tty->t_param = ttycons_param;
+ sc->sc_tty->t_sc = sc;
maj = cdevsw_lookup_major(&ttycons_cdevsw);
cn_tab->cn_dev = makedev(maj, device_unit(self));
@@ -301,8 +303,8 @@
static void
ttycons_start(struct tty *t)
{
- u_char buf[1024+1];
- u_char *p = buf;
+ struct ttycons_softc *sc = t->t_sc;
+ u_char *p = sc->sc_buf;
int s, len, brem;
s = spltty();
@@ -313,7 +315,7 @@
t->t_state |= TS_BUSY;
splx(s);
- brem = q_to_b(&t->t_outq, buf, sizeof(buf) - 1);
+ brem = q_to_b(&t->t_outq, sc->sc_buf, sizeof(sc->sc_buf));
while (brem > 0) {
len = thunk_write(1, p, brem);
Home |
Main Index |
Thread Index |
Old Index