From nobody Fri May 06 17:27:35 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EEC9C1AB117C; Fri, 6 May 2022 17:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KvyF36RPSz4Zb9; Fri, 6 May 2022 17:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651858055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U9eYQnbHAhYXRjD/YjQ4nzVsCcn6yliDrbSnrgCDCv4=; b=n8Kvy0OsjwM432Fd0rtDySxu70ff24dsalG7qLvpiWcfs3TJRSIYEn5//HgAnK1H0KdS4u uJxVJmgisOOYX96I7ZDBbvDE4BFbD/iNIucTvy5ayGJT4sbgA234cFTElrU7fJ/lRgzzxt XI99UmI86ri8NHXAVBHl6LzUIOC7qCWZG02MdKO01MjXCanBh7fm2jviPvt1Lzx3Ozse+q l3nrU+rfpjQ2+mFiKClZ/lsFHP0LW8kcV9YpLqZRypkoKylqptHExGkcU8IlbRJ4Gx9BQw K1VMRFgcuPG5sB+vSXCw+sZhi+Yp+8Ce6If8oaiaZ7fr2uL6/Vz/tCxUCmsO9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8C8E1FDF2; Fri, 6 May 2022 17:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 246HRZb1086626; Fri, 6 May 2022 17:27:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 246HRZSo086625; Fri, 6 May 2022 17:27:35 GMT (envelope-from git) Date: Fri, 6 May 2022 17:27:35 GMT Message-Id: <202205061727.246HRZSo086625@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: ff1c8af8c349 - main - vt: use TERMINAL_DECLARE_EARLY() macro List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff1c8af8c34965cc13e53f8290adc5a2fe09501b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651858055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U9eYQnbHAhYXRjD/YjQ4nzVsCcn6yliDrbSnrgCDCv4=; b=dlGQ98Rk/LLtKycviOwEnJhc7dCLbB5lJQ+vSa+01R+KwSwsUX+m6oY1N18wlEvvBQISEx msnRgT1gwj+RhObbqzBJDpFwIpSmbjgC58O2LRNEeuWEkf3arKZ3/+x2o/+5RWHQ7ASVZm vz0733U9U05NQLbm5ySDziT0bilmdNMevMRGO8HDjkPEILBCt79o1JBcE4fH94CaGHQI6W UxXXznsIc3j7y0Ukp+UbGX3bIGIunq/rze1raAPIFWL/Bq2bRMl8H73PmS4jWpSXzyM7iU 0HLMZU7vUq5dco0vABzFXVY5o9DSymUfY3brFYKFuPfQmzWIAOe2jGZThlukPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651858055; a=rsa-sha256; cv=none; b=o/+mFvvH9JnCxvMqYT5t8A1GeZjYyoLQSQEG1bT2ENKLuVsKSm2Ii5kqKKZhTtdHb+uq1A Dv3qa3E+kH/9xU6HN6qPX3frB7DwDZKOhD0kCc5GSAlFEr1AH80rcGiIDfEtwzGn0tbQv8 DvUWPQS0JySMO7jD4TXLjV8+9eJETbYvTBbQrW5oePgVVdnpDs192azSAepz0V/VItVjNy TnnuvtrQ8Res0jSBxo53lgEtRvb4pKQFtZEYoS2m6Ew4ElSGZpiRcVV8M4sMOf7Bcjb7yw M9lmeR6F7IyWsqEm37Z/G6w79C2Y3FpzBSKJOXJw7iXiIJAJoKC6Omb5zisp+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ff1c8af8c34965cc13e53f8290adc5a2fe09501b commit ff1c8af8c34965cc13e53f8290adc5a2fe09501b Author: Mitchell Horne AuthorDate: 2021-09-20 19:50:04 +0000 Commit: Mitchell Horne CommitDate: 2022-05-06 17:24:01 +0000 vt: use TERMINAL_DECLARE_EARLY() macro It simplifies the declaration of the driver structures a little. There are no current consumers of this macro, in fact it looks like it was added for exactly this purpose. This decreases the scope of some variables, so rework the initialization in vt_init_logos() such that it doesn't require them. No functional change intended. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D34820 --- sys/dev/vt/vt.h | 2 -- sys/dev/vt/vt_core.c | 16 +++------------- sys/dev/vt/vt_cpulogos.c | 10 ++++++---- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/sys/dev/vt/vt.h b/sys/dev/vt/vt.h index 5ba64388bd27..b4361f77317c 100644 --- a/sys/dev/vt/vt.h +++ b/sys/dev/vt/vt.h @@ -386,8 +386,6 @@ struct vt_driver { */ extern struct vt_device vt_consdev; -extern struct terminal vt_consterm; -extern const struct terminal_class vt_termclass; void vt_upgrade(struct vt_device *vd); #define PIXEL_WIDTH(w) ((w) / 8) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 3ddd5dfa743a..860cc0b00781 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -87,7 +87,7 @@ static tc_opened_t vtterm_opened; static tc_ioctl_t vtterm_ioctl; static tc_mmap_t vtterm_mmap; -const struct terminal_class vt_termclass = { +static const struct terminal_class vt_termclass = { .tc_bell = vtterm_bell, .tc_cursor = vtterm_cursor, .tc_putchar = vtterm_putchar, @@ -202,7 +202,7 @@ SET_DECLARE(vt_drv_set, struct vt_driver); #define _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_MAX_HEIGHT)) #define _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_MAX_WIDTH)) -struct terminal vt_consterm; +static struct terminal vt_consterm; static struct vt_window vt_conswindow; #ifndef SC_NO_CONSDRAWN static term_char_t vt_consdrawn[PIXEL_HEIGHT(VT_FB_MAX_HEIGHT) * PIXEL_WIDTH(VT_FB_MAX_WIDTH)]; @@ -262,19 +262,9 @@ static struct vt_window vt_conswindow = { .vw_bell_pitch = VT_BELLPITCH, .vw_bell_duration = VT_BELLDURATION, }; -struct terminal vt_consterm = { - .tm_class = &vt_termclass, - .tm_softc = &vt_conswindow, - .tm_flags = TF_CONS, -}; -static struct consdev vt_consterm_consdev = { - .cn_ops = &termcn_cnops, - .cn_arg = &vt_consterm, - .cn_name = "ttyv0", -}; /* Add to set of consoles. */ -DATA_SET(cons_set, vt_consterm_consdev); +TERMINAL_DECLARE_EARLY(vt_consterm, vt_termclass, &vt_conswindow); /* * Right after kmem is done to allow early drivers to use locking and allocate diff --git a/sys/dev/vt/vt_cpulogos.c b/sys/dev/vt/vt_cpulogos.c index 6450c89ead6d..7e0be12b3adb 100644 --- a/sys/dev/vt/vt_cpulogos.c +++ b/sys/dev/vt/vt_cpulogos.c @@ -221,12 +221,14 @@ vt_init_logos(void *dummy) if (!vt_splash_cpu) return; - tm = &vt_consterm; - vw = tm->tm_softc; + vd = &vt_consdev; + if (vd == NULL) + return; + vw = vd->vd_curwindow; if (vw == NULL) return; - vd = vw->vw_device; - if (vd == NULL) + tm = vw->vw_terminal; + if (tm == NULL) return; vf = vw->vw_font; if (vf == NULL)