MCPcopy Create free account
hub / github.com/F-Stack/f-stack / terminal_init

Function terminal_init

freebsd/kern/subr_terminal.c:168–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166 TCOLOR_BG_FUDGED(TCOLOR_256TO16((a)->ta_bgcolor)))
167
168static void
169terminal_init(struct terminal *tm)
170{
171 int fg, bg;
172
173 if (tm->tm_flags & TF_CONS)
174 mtx_init(&tm->tm_mtx, "trmlck", NULL, MTX_SPIN);
175
176 teken_init(&tm->tm_emulator, &terminal_drawmethods, tm);
177
178 fg = bg = -1;
179 TUNABLE_INT_FETCH("teken.fg_color", &fg);
180 TUNABLE_INT_FETCH("teken.bg_color", &bg);
181
182 if (fg != -1) {
183 default_message.ta_fgcolor = fg;
184 kernel_message.ta_fgcolor = fg;
185 }
186 if (bg != -1) {
187 default_message.ta_bgcolor = bg;
188 kernel_message.ta_bgcolor = bg;
189 }
190
191 if (default_message.ta_bgcolor == TC_WHITE) {
192 default_message.ta_bgcolor |= TC_LIGHT;
193 kernel_message.ta_bgcolor |= TC_LIGHT;
194 }
195
196 if (default_message.ta_bgcolor == TC_BLACK &&
197 default_message.ta_fgcolor < TC_NCOLORS)
198 kernel_message.ta_fgcolor |= TC_LIGHT;
199 teken_set_defattr(&tm->tm_emulator, &default_message);
200}
201
202struct terminal *
203terminal_alloc(const struct terminal_class *tc, void *softc)

Callers 3

terminal_allocFunction · 0.85
termcn_cnregisterFunction · 0.85
termcn_cnprobeFunction · 0.85

Calls 1

mtx_initFunction · 0.85

Tested by

no test coverage detected