diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2009-03-10 11:28:54 +0000 |
|---|---|---|
| committer | Ed Schouten <ed@FreeBSD.org> | 2009-03-10 11:28:54 +0000 |
| commit | 630b9bf23fa7e7e4e8248031eb637900e91275d0 (patch) | |
| tree | 81b513a4d1a972e44f59deb62bedb21c604e26ae /sys/dev/syscons/syscons.c | |
| parent | 9541ada9a0c4eb92928b27bc7153bf582c433948 (diff) | |
Notes
Diffstat (limited to 'sys/dev/syscons/syscons.c')
| -rw-r--r-- | sys/dev/syscons/syscons.c | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 711272eb8b72..6791d64cb1bc 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -95,16 +95,10 @@ static default_attr user_default = { SC_NORM_REV_ATTR, }; -static default_attr kernel_default = { - SC_KERNEL_CONS_ATTR, - SC_KERNEL_CONS_REV_ATTR, -}; - static int sc_console_unit = -1; static int sc_saver_keyb_only = 1; static scr_stat *sc_console; static struct consdev *sc_consptr; -static void *kernel_console_ts; static scr_stat main_console; static struct tty *main_devs[MAXCONS]; @@ -323,7 +317,7 @@ sctty_outwakeup(struct tty *tp) len = ttydisc_getc(tp, buf, sizeof buf); if (len == 0) break; - sc_puts(scp, buf, len); + sc_puts(scp, buf, len, 0); } } @@ -373,22 +367,8 @@ sc_attach_unit(int unit, int flags) /* assert(sc_console != NULL) */ flags |= SC_KERNEL_CONSOLE; scmeminit(NULL); - - scinit(unit, flags); - - if (sc_console->tsw->te_size > 0) { - /* assert(sc_console->ts != NULL); */ - kernel_console_ts = sc_console->ts; - sc_console->ts = malloc(sc_console->tsw->te_size, - M_DEVBUF, M_WAITOK); - bcopy(kernel_console_ts, sc_console->ts, sc_console->tsw->te_size); - (*sc_console->tsw->te_default_attr)(sc_console, - user_default.std_color, - user_default.rev_color); - } - } else { - scinit(unit, flags); } + scinit(unit, flags); sc = sc_get_softc(unit, flags & SC_KERNEL_CONSOLE); sc->config = flags; @@ -1507,7 +1487,6 @@ sc_cnputc(struct consdev *cd, int c) { u_char buf[1]; scr_stat *scp = sc_console; - void *save; #ifndef SC_NO_HISTORY #if 0 struct tty *tp; @@ -1543,12 +1522,8 @@ sc_cnputc(struct consdev *cd, int c) } #endif /* !SC_NO_HISTORY */ - save = scp->ts; - if (kernel_console_ts != NULL) - scp->ts = kernel_console_ts; buf[0] = c; - sc_puts(scp, buf, 1); - scp->ts = save; + sc_puts(scp, buf, 1, 1); s = spltty(); /* block sckbdevent and scrn_timer */ sccnupdate(scp); @@ -2492,7 +2467,7 @@ exchange_scr(sc_softc_t *sc) } void -sc_puts(scr_stat *scp, u_char *buf, int len) +sc_puts(scr_stat *scp, u_char *buf, int len, int kernel) { int need_unlock = 0; @@ -2507,7 +2482,7 @@ sc_puts(scr_stat *scp, u_char *buf, int len) need_unlock = 1; mtx_lock_spin(&scp->scr_lock); } - (*scp->tsw->te_puts)(scp, buf, len); + (*scp->tsw->te_puts)(scp, buf, len, kernel); if (need_unlock) mtx_unlock_spin(&scp->scr_lock); } @@ -2754,8 +2729,8 @@ scinit(int unit, int flags) if (sc_init_emulator(scp, SC_DFLT_TERM)) sc_init_emulator(scp, "*"); (*scp->tsw->te_default_attr)(scp, - kernel_default.std_color, - kernel_default.rev_color); + user_default.std_color, + user_default.rev_color); } else { /* assert(sc_malloc) */ sc->dev = malloc(sizeof(struct tty *)*sc->vtys, M_DEVBUF, |
