Page MenuHomeFreeBSD

vt: use TERMINAL_DECLARE_EARLY() macro
ClosedPublic

Authored by mhorne on Apr 7 2022, 1:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jul 20, 1:02 AM
Unknown Object (File)
Jul 1 2025, 5:56 PM
Unknown Object (File)
Jun 28 2025, 3:12 AM
Unknown Object (File)
Jun 21 2025, 10:08 AM
Unknown Object (File)
Jun 20 2025, 7:47 PM
Unknown Object (File)
Jun 19 2025, 5:08 AM
Unknown Object (File)
Jun 18 2025, 12:02 PM
Unknown Object (File)
Jun 16 2025, 3:27 PM
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.