From nobody Mon May 16 13:51:25 2022 X-Original-To: dev-commits-src-branches@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 B488C1B3599B; Mon, 16 May 2022 13:51:26 +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 4L20z22zJDz3Gpw; Mon, 16 May 2022 13:51:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652709086; 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=QU7rjoPaPLQv1QXOumM7ew0UXovsyWJ8uUBcbQIm8x8=; b=GNgMTypE5iyxEViGM5c7vGcY0NRIjvUb+WP8KCcoCoBx8boJULv6sk1jhFEH0SAUzvhPCy h8Jr8rc1QDof33rckYdp9F1gFmqxyvWKZkC9x3/AYEGev/D2rhRAdDtpk3Pcbwqs5tYnIC nvU/yQ78UcI5JHy4Sk7MX1Sh5TXVz/YX49FTUbarjWFppbIQU7mttSumPyhZ4Nm+d3Oiv9 vs2PnGCsyiJ3W9rN8PkxYAi9N4qwPln+i6mph1nmzX3G93GjfxC4PvogZoPT07ktIi4bXP Z7eJKsKaeEqueuZ+xHDhKtbrkJwLzRD92av2nqtD8XAyyWTWZi0kcInNOBDW6A== 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 ED47C21583; Mon, 16 May 2022 13:51:25 +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 24GDpPaA080516; Mon, 16 May 2022 13:51:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24GDpPr2080505; Mon, 16 May 2022 13:51:25 GMT (envelope-from git) Date: Mon, 16 May 2022 13:51:25 GMT Message-Id: <202205161351.24GDpPr2080505@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 65c10f12df1c - stable/13 - vt: use TERMINAL_DECLARE_EARLY() macro List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 65c10f12df1caeb22bc06c258c1bc45b38a80518 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652709086; 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=QU7rjoPaPLQv1QXOumM7ew0UXovsyWJ8uUBcbQIm8x8=; b=cksCzzHX6p8kK720RKrdjF+W4iyGSKjvDloW1oKQE4TfeWPwQUghXtTmFwcK5uTtfPrfnB Ga12aMl374gCbzYlgJKjpAGW71YKzo4jLCPWKQc0PEj1DE69ALs3INMt0NKkno+WDRjw5H Vqbg6I/r9Fyy3h3EqZK6AZv1FeXCXNltVCfwKhAkM3/zD+pC4zCgNeJl/7BU//fIyx4fVO Ujw5lQZt3SKJrMJ2kZ075J+bHfa4PYPG5uQMjeuf1na+hWuPuBOkYvFuvZy9WQn6nxvgsn FFOALVVQ6P1m7TeZOFeCSIY+cZZbeCMBARc8AOEPbfSqJvsorazZPWCcOJ86lg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652709086; a=rsa-sha256; cv=none; b=T+yKwHEM/w/n6sJacyi61T9NMbcXExaOOZpfzxerQJ0UzKWtoEGXG8DMhwBnfyUPMpvleB 6HrCuMIKQBDv42uXLYcIo+eKzRsoXkwPvZ+9UpW6x1pT+2YJJML7PwGFPDZrjDGaq9DEyN 7ZwWvdji20oZ30ZdZIVBJyj5ySyWKyV6CA/iIU8xluK0OqtdKb0hFDn5nWiGEOBdYcslfy c/Va2cooaGvHMQiT3xAWYdBesALm0JyP3VTmMb6X4sd/u7m3SvmHiTeY0DIBSrNW6hYn/O uMxdTvdSdcTUx6fD4oENKSUK1g2FCdzg6Ow7Ad5l9a0VTSSnJ2CiNGnbtqkdUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=65c10f12df1caeb22bc06c258c1bc45b38a80518 commit 65c10f12df1caeb22bc06c258c1bc45b38a80518 Author: Mitchell Horne AuthorDate: 2021-09-20 19:50:04 +0000 Commit: Mitchell Horne CommitDate: 2022-05-16 13:34:04 +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 (cherry picked from commit ff1c8af8c34965cc13e53f8290adc5a2fe09501b) --- 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 83bfda1cb876..2357b377f1e5 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)