From owner-svn-src-head@freebsd.org Fri Mar 10 11:44:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08480D06FC0; Fri, 10 Mar 2017 11:44:11 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B075F1300; Fri, 10 Mar 2017 11:44:10 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2ABi9VI016030; Fri, 10 Mar 2017 11:44:09 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2ABi9jR016029; Fri, 10 Mar 2017 11:44:09 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201703101144.v2ABi9jR016029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 10 Mar 2017 11:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315000 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Mar 2017 11:44:11 -0000 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;