Module Name: src
Committed By: jmcneill
Date: Wed Dec 21 11:53:07 UTC 2011
Modified Files:
src/sys/arch/usermode/dev: ttycons.c
Log Message:
move the (now 1024 byte) printing buffer off the stack
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/usermode/dev/ttycons.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.14 src/sys/arch/usermode/dev/ttycons.c:1.15
--- src/sys/arch/usermode/dev/ttycons.c:1.14 Wed Dec 21 10:02:45 2011
+++ src/sys/arch/usermode/dev/ttycons.c Wed Dec 21 11:53:07 2011
@@ -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 <[email protected]>
@@ -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 ttycons_softc {
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 @@ ttycons_attach(device_t parent, device_t
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 @@ ttycons_ioctl(dev_t dev, u_long cmd, voi
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 @@ ttycons_start(struct tty *t)
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);