Page MenuHomeFreeBSD

vt: use TERMINAL_DECLARE_EARLY() macro
ClosedPublic

Authored by mhorne on Apr 7 2022, 1:05 PM.
Tags
None
Referenced Files
F97556482: D34820.diff
Mon, Sep 30, 1:32 AM
Unknown Object (File)
Fri, Sep 27, 7:36 PM
Unknown Object (File)
Fri, Sep 27, 10:06 AM
Unknown Object (File)
Wed, Sep 25, 10:55 PM
Unknown Object (File)
Mon, Sep 23, 2:51 PM
Unknown Object (File)
Sun, Sep 22, 1:46 AM
Unknown Object (File)
Mon, Sep 16, 2:45 PM
Unknown Object (File)
Sun, Sep 15, 1:06 AM
Subscribers

Details

Summary

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 vt_init_logos()
such that it doesn't require them.

No functional change intended.

Test Plan

Build and boot kernel with CPU splash logos enabled.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mhorne requested review of this revision.Apr 7 2022, 1:05 PM

For reference:

#define	TERMINAL_DECLARE_EARLY(name, class, softc)			\
	static struct terminal name = {					\
		.tm_class = &class,					\
		.tm_softc = softc,					\
		.tm_flags = TF_CONS,					\
	};								\
	CONSOLE_DEVICE(name ## _consdev, termcn_cnops, &name)
#define	CONSOLE_DEVICE(name, ops, arg)					\
	static struct consdev name = {					\
		.cn_ops = &ops,						\
		.cn_arg = (arg),					\
	};								\
	DATA_SET(cons_set, name)
sys/dev/vt/vt_core.c
273

We lose this explicit initialization of cn_name, but it gets set to the same in vtterm_cnprobe().

Does this seem okay @emaste? This was a drive-by cleanup I made a while ago when reading some code; I found it on a stale local branch but there's no larger motivation.

This revision was not accepted when it landed; it landed in state Needs Review.May 6 2022, 5:28 PM
This revision was automatically updated to reflect the committed changes.