Lines Matching refs:tem

168 tem_add(struct tem_vt_state *tem)
170 ASSERT(MUTEX_HELD(&tems.ts_lock) && MUTEX_HELD(&tem->tvs_lock));
172 list_insert_head(&tems.ts_list, tem);
176 tem_rm(struct tem_vt_state *tem)
178 ASSERT(MUTEX_HELD(&tems.ts_lock) && MUTEX_HELD(&tem->tvs_lock));
180 list_remove(&tems.ts_list, tem);
190 struct tem_vt_state *tem = (struct tem_vt_state *)tem_arg;
193 mutex_enter(&tem->tvs_lock);
195 if (!tem->tvs_initialized) {
196 mutex_exit(&tem->tvs_lock);
201 tem_safe_check_first_time(tem, credp, CALLED_FROM_NORMAL);
202 tem_safe_terminal_emulate(tem, buf, len, credp, CALLED_FROM_NORMAL);
204 mutex_exit(&tem->tvs_lock);
285 * A tem is regarded as initialized only after tem_internal_init(),
310 * re-init the tem after video mode has changed and tems_info has
314 tem_reinit(struct tem_vt_state *tem, boolean_t reset_display)
316 ASSERT(MUTEX_HELD(&tems.ts_lock) && MUTEX_HELD(&tem->tvs_lock));
318 tem_free_buf(tem); /* only free virtual buffers */
321 tem_internal_init(tem, kcred, B_FALSE, reset_display);
325 tem_free_buf(struct tem_vt_state *tem)
327 ASSERT(tem != NULL && MUTEX_HELD(&tem->tvs_lock));
329 if (tem->tvs_outbuf != NULL)
330 kmem_free(tem->tvs_outbuf, tem->tvs_outbuf_size);
331 if (tem->tvs_pix_data != NULL)
332 kmem_free(tem->tvs_pix_data, tem->tvs_pix_data_size);
333 if (tem->tvs_screen_buf != NULL)
334 kmem_free(tem->tvs_screen_buf, tem->tvs_screen_buf_size);
335 if (tem->tvs_fg_buf != NULL)
336 kmem_free(tem->tvs_fg_buf, tem->tvs_color_buf_size);
337 if (tem->tvs_bg_buf != NULL)
338 kmem_free(tem->tvs_bg_buf, tem->tvs_color_buf_size);
344 struct tem_vt_state *tem = (struct tem_vt_state *)tem_arg;
347 mutex_enter(&tem->tvs_lock);
349 if (tem->tvs_isactive && tem->tvs_fbmode == KD_TEXT)
350 tem_safe_blank_screen(tem, credp, CALLED_FROM_NORMAL);
352 tem_free_buf(tem);
353 tem_rm(tem);
355 if (tems.ts_active == tem)
358 mutex_exit(&tem->tvs_lock);
361 kmem_free(tem, sizeof (struct tem_vt_state));
638 * Only need to reinit the active tem.
787 tem_prom_scroll_up(struct tem_vt_state *tem, int nrows, cred_t *credp,
808 tem_safe_pix_cls_range(tem, 0, nrows, tems.ts_p_offset.y,
820 tem_adjust_row(struct tem_vt_state *tem, int prom_row, cred_t *credp,
845 * below our tem's lower boundary.
849 tem_prom_scroll_up(tem, scroll_up_lines, credp, called_from);
857 tem_pix_align(struct tem_vt_state *tem, cred_t *credp,
875 * kernel console tem is different with that of prom
876 * tem.
878 row = tem_adjust_row(tem, row, credp, called_from);
881 tem->tvs_first_line = row + 1;
884 tem->tvs_s_cursor.row = tem->tvs_c_cursor.row =
886 tem->tvs_s_cursor.col = tem->tvs_c_cursor.col = 0;
888 tem_safe_reset_display(tem, credp, called_from, B_TRUE, B_TRUE);
933 struct tem_vt_state *tem = (struct tem_vt_state *)tem_arg;
937 mutex_enter(&tem->tvs_lock);
938 fbmode = tem->tvs_fbmode;
939 mutex_exit(&tem->tvs_lock);
947 struct tem_vt_state *tem = (struct tem_vt_state *)tem_arg;
950 mutex_enter(&tem->tvs_lock);
952 if (fbmode == tem->tvs_fbmode) {
953 mutex_exit(&tem->tvs_lock);
958 tem->tvs_fbmode = fbmode;
960 if (tem->tvs_isactive) {
961 tem_kdsetmode(tem->tvs_fbmode, credp);
963 tem_safe_unblank_screen(tem, credp, CALLED_FROM_NORMAL);
966 mutex_exit(&tem->tvs_lock);
973 struct tem_vt_state *tem = (struct tem_vt_state *)tem_arg;
976 tems.ts_active = tem;
978 mutex_enter(&tem->tvs_lock);
979 tem->tvs_isactive = B_TRUE;
981 tem_kdsetmode(tem->tvs_fbmode, credp);
984 tem_safe_unblank_screen(tem, credp, CALLED_FROM_NORMAL);
986 mutex_exit(&tem->tvs_lock);