Date: Fri, 10 Mar 2017 11:44:09 +0000 (UTC) From: Bruce Evans <bde@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315000 - head/sys/dev/syscons Message-ID: <201703101144.v2ABi9jR016029@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bde Date: Fri Mar 10 11:44:09 2017 New Revision: 315000 URL: https://svnweb.freebsd.org/changeset/base/315000 Log: Start fixing some bugs in attribute handling. This change just does cleanups missed in r56043 17 years ago. The default attributes were still stored in structs for the purpose of changing them and passing around pointers to the defaults, but r56043 added another layer that made the defaults invariant and only used for initialization and reset. Just use the defaults directly. This was already done for the kernel defaults. The defaults for reverse attributes aren't actually used, but are ignored in layers that no longer support them. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Fri Mar 10 10:58:31 2017 (r314999) +++ head/sys/dev/syscons/syscons.c Fri Mar 10 11:44:09 2017 (r315000) @@ -91,16 +91,6 @@ __FBSDID("$FreeBSD$"); /* NULL-safe version of "tty_opened()" */ #define tty_opened_ns(tp) ((tp) != NULL && tty_opened(tp)) -typedef struct default_attr { - int std_color; /* normal hardware color */ - int rev_color; /* reverse hardware color */ -} default_attr; - -static default_attr user_default = { - SC_NORM_ATTR, - SC_NORM_REV_ATTR, -}; - static u_char sc_kattrtab[MAXCPU]; static int sc_console_unit = -1; @@ -3162,9 +3152,7 @@ scinit(int unit, int flags) if (sc_init_emulator(scp, SC_DFLT_TERM)) sc_init_emulator(scp, "*"); - (*scp->tsw->te_default_attr)(scp, - user_default.std_color, - user_default.rev_color); + (*scp->tsw->te_default_attr)(scp, SC_NORM_ATTR, SC_NORM_REV_ATTR); } else { /* assert(sc_malloc) */ sc->dev = malloc(sizeof(struct tty *)*sc->vtys, M_DEVBUF, @@ -3578,8 +3566,7 @@ sc_init_emulator(scr_stat *scp, char *na scp->rndr = rndr; scp->rndr->init(scp); - /* XXX */ - (*sw->te_default_attr)(scp, user_default.std_color, user_default.rev_color); + (*sw->te_default_attr)(scp, SC_NORM_ATTR, SC_NORM_REV_ATTR); sc_clear_screen(scp); return 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703101144.v2ABi9jR016029>