| 166 | TCOLOR_BG_FUDGED(TCOLOR_256TO16((a)->ta_bgcolor))) |
| 167 | |
| 168 | static void |
| 169 | terminal_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 | |
| 202 | struct terminal * |
| 203 | terminal_alloc(const struct terminal_class *tc, void *softc) |
no test coverage detected