Lines Matching refs:tems
113 tem_state_t tems; /* common term info */ variable
114 _NOTE(MUTEX_PROTECTS_DATA(tems.ts_lock, tems))
140 mutex_init(&tems.ts_lock, (char *)NULL, MUTEX_DRIVER, NULL); in _init()
141 list_create(&tems.ts_list, sizeof (struct tem_vt_state), in _init()
143 tems.ts_active = NULL; in _init()
170 ASSERT(MUTEX_HELD(&tems.ts_lock) && MUTEX_HELD(&tem->tvs_lock)); in tem_add()
172 list_insert_head(&tems.ts_list, tem); in tem_add()
178 ASSERT(MUTEX_HELD(&tems.ts_lock) && MUTEX_HELD(&tem->tvs_lock)); in tem_rm()
180 list_remove(&tems.ts_list, tem); in tem_rm()
192 mutex_enter(&tems.ts_lock); in tem_write()
197 mutex_exit(&tems.ts_lock); in tem_write()
205 mutex_exit(&tems.ts_lock); in tem_write()
219 ASSERT(MUTEX_HELD(&tems.ts_lock) && MUTEX_HELD(&ptem->tvs_lock)); in tem_internal_init()
221 if (tems.ts_display_mode == VIS_PIXEL) { in tem_internal_init()
222 ptem->tvs_pix_data_size = tems.ts_pix_data_size; in tem_internal_init()
227 ptem->tvs_outbuf_size = tems.ts_c_dimension.width; in tem_internal_init()
231 width = tems.ts_c_dimension.width; in tem_internal_init()
232 height = tems.ts_c_dimension.height; in tem_internal_init()
278 mutex_enter(&tems.ts_lock); in tem_init()
291 if (!tems.ts_initialized) { in tem_init()
297 mutex_exit(&tems.ts_lock); in tem_init()
304 mutex_exit(&tems.ts_lock); in tem_init()
316 ASSERT(MUTEX_HELD(&tems.ts_lock) && MUTEX_HELD(&tem->tvs_lock)); in tem_reinit()
346 mutex_enter(&tems.ts_lock); in tem_destroy()
355 if (tems.ts_active == tem) in tem_destroy()
356 tems.ts_active = NULL; in tem_destroy()
359 mutex_exit(&tems.ts_lock); in tem_destroy()
369 ASSERT(MUTEX_HELD(&tems.ts_lock)); in tems_failed()
372 (void) ldi_ioctl(tems.ts_hdl, VIS_DEVFINI, 0, in tems_failed()
375 (void) ldi_close(tems.ts_hdl, NULL, credp); in tems_failed()
376 tems.ts_hdl = NULL; in tems_failed()
393 mutex_enter(&tems.ts_lock); in tem_info_init()
395 if (tems.ts_initialized) { in tem_info_init()
396 mutex_exit(&tems.ts_lock); in tem_info_init()
411 mutex_exit(&tems.ts_lock); in tem_info_init()
415 &tems.ts_hdl, term_li) != 0) { in tem_info_init()
419 mutex_exit(&tems.ts_lock); in tem_info_init()
430 if (ldi_ioctl(tems.ts_hdl, VIS_DEVINIT, in tem_info_init()
434 mutex_exit(&tems.ts_lock); in tem_info_init()
444 mutex_exit(&tems.ts_lock); in tem_info_init()
448 if ((tems.ts_fb_polledio = temargs.polledio) == NULL) { in tem_info_init()
452 mutex_exit(&tems.ts_lock); in tem_info_init()
461 mutex_exit(&tems.ts_lock); in tem_info_init()
468 mutex_exit(&tems.ts_lock); in tem_info_init()
481 tems_get_initial_color(&tems.ts_init_color); in tem_info_init()
483 tems.ts_initialized = 1; /* initialization flag */ in tem_info_init()
485 for (p = list_head(&tems.ts_list); p != NULL; in tem_info_init()
486 p = list_next(&tems.ts_list, p)) { in tem_info_init()
494 mutex_exit(&tems.ts_lock); in tem_info_init()
506 if (tems.ts_pdepth != tp->depth) in tems_check_videomode()
510 if (tems.ts_c_dimension.width != tp->width || in tems_check_videomode()
511 tems.ts_c_dimension.height != tp->height) in tems_check_videomode()
514 if (tems.ts_p_dimension.width != tp->width || in tems_check_videomode()
515 tems.ts_p_dimension.height != tp->height) in tems_check_videomode()
526 int old_blank_buf_size = tems.ts_c_dimension.width; in tems_setup_terminal()
528 ASSERT(MUTEX_HELD(&tems.ts_lock)); in tems_setup_terminal()
530 tems.ts_pdepth = tp->depth; in tems_setup_terminal()
531 tems.ts_linebytes = tp->linebytes; in tems_setup_terminal()
532 tems.ts_display_mode = tp->mode; in tems_setup_terminal()
536 tems.ts_p_dimension.width = 0; in tems_setup_terminal()
537 tems.ts_p_dimension.height = 0; in tems_setup_terminal()
538 tems.ts_c_dimension.width = tp->width; in tems_setup_terminal()
539 tems.ts_c_dimension.height = tp->height; in tems_setup_terminal()
540 tems.ts_callbacks = &tem_safe_text_callbacks; in tems_setup_terminal()
553 tems.ts_c_dimension.height = (screen_size_t)height; in tems_setup_terminal()
554 tems.ts_c_dimension.width = (screen_size_t)width; in tems_setup_terminal()
556 tems.ts_p_dimension.height = tp->height; in tems_setup_terminal()
557 tems.ts_p_dimension.width = tp->width; in tems_setup_terminal()
559 tems.ts_callbacks = &tem_safe_pix_callbacks; in tems_setup_terminal()
568 set_font(&tems.ts_font, in tems_setup_terminal()
569 &tems.ts_c_dimension.height, in tems_setup_terminal()
570 &tems.ts_c_dimension.width, in tems_setup_terminal()
571 tems.ts_p_dimension.height, in tems_setup_terminal()
572 tems.ts_p_dimension.width); in tems_setup_terminal()
574 tems.ts_p_offset.y = (tems.ts_p_dimension.height - in tems_setup_terminal()
575 (tems.ts_c_dimension.height * tems.ts_font.height)) / 2; in tems_setup_terminal()
576 tems.ts_p_offset.x = (tems.ts_p_dimension.width - in tems_setup_terminal()
577 (tems.ts_c_dimension.width * tems.ts_font.width)) / 2; in tems_setup_terminal()
579 tems.ts_pix_data_size = in tems_setup_terminal()
580 tems.ts_font.width * tems.ts_font.height; in tems_setup_terminal()
582 tems.ts_pix_data_size *= 4; in tems_setup_terminal()
584 tems.ts_pdepth = tp->depth; in tems_setup_terminal()
590 if (tems.ts_blank_line) in tems_setup_terminal()
591 kmem_free(tems.ts_blank_line, old_blank_buf_size); in tems_setup_terminal()
593 tems.ts_blank_line = (unsigned char *) in tems_setup_terminal()
594 kmem_alloc(tems.ts_c_dimension.width, KM_SLEEP); in tems_setup_terminal()
595 for (i = 0; i < tems.ts_c_dimension.width; i++) in tems_setup_terminal()
596 tems.ts_blank_line[i] = ' '; in tems_setup_terminal()
621 ASSERT(!(list_is_empty(&tems.ts_list))); in tems_modechange_callback()
623 mutex_enter(&tems.ts_lock); in tems_modechange_callback()
630 mutex_exit(&tems.ts_lock); in tems_modechange_callback()
640 struct tem_vt_state *active = tems.ts_active; in tems_modechange_callback()
641 tems.ts_pdepth = devinit->depth; in tems_modechange_callback()
648 mutex_exit(&tems.ts_lock); in tems_modechange_callback()
652 tems_setup_terminal(devinit, tems.ts_c_dimension.height, in tems_modechange_callback()
653 tems.ts_c_dimension.width); in tems_modechange_callback()
655 for (p = list_head(&tems.ts_list); p != NULL; in tems_modechange_callback()
656 p = list_next(&tems.ts_list, p)) { in tems_modechange_callback()
663 if (tems.ts_modechg_cb == NULL) { in tems_modechange_callback()
664 mutex_exit(&tems.ts_lock); in tems_modechange_callback()
668 cb = tems.ts_modechg_cb; in tems_modechange_callback()
669 cb_arg = tems.ts_modechg_arg; in tems_modechange_callback()
674 mutex_exit(&tems.ts_lock); in tems_modechange_callback()
690 (void) ldi_ioctl(tems.ts_hdl, VIS_CONSDISPLAY, in tems_display_layered()
707 (void) ldi_ioctl(tems.ts_hdl, VIS_CONSCOPY, in tems_copy_layered()
722 (void) ldi_ioctl(tems.ts_hdl, VIS_CONSCURSOR, in tems_cursor_layered()
731 (void) ldi_ioctl(tems.ts_hdl, KDSETMODE, in tem_kdsetmode()
745 switch (tems.ts_pdepth) { in tems_reset_colormap()
752 (void) ldi_ioctl(tems.ts_hdl, VIS_PUTCMAP, (intptr_t)&cm, in tems_reset_colormap()
762 mutex_enter(&tems.ts_lock); in tem_get_size()
763 *r = (ushort_t)tems.ts_c_dimension.height; in tem_get_size()
764 *c = (ushort_t)tems.ts_c_dimension.width; in tem_get_size()
765 *x = (ushort_t)tems.ts_p_dimension.width; in tem_get_size()
766 *y = (ushort_t)tems.ts_p_dimension.height; in tem_get_size()
767 mutex_exit(&tems.ts_lock); in tem_get_size()
774 mutex_enter(&tems.ts_lock); in tem_register_modechg_cb()
776 tems.ts_modechg_cb = func; in tem_register_modechg_cb()
777 tems.ts_modechg_arg = arg; in tem_register_modechg_cb()
779 mutex_exit(&tems.ts_lock); in tem_register_modechg_cb()
794 ma.s_row = nrows * tems.ts_font.height; in tem_prom_scroll_up()
795 ma.e_row = tems.ts_p_dimension.height - 1; in tem_prom_scroll_up()
799 ma.e_col = tems.ts_p_dimension.width - 1; in tem_prom_scroll_up()
805 width = tems.ts_font.width; in tem_prom_scroll_up()
806 ncols = (tems.ts_p_dimension.width + (width - 1))/ width; in tem_prom_scroll_up()
808 tem_safe_pix_cls_range(tem, 0, nrows, tems.ts_p_offset.y, in tem_prom_scroll_up()
836 tems.ts_p_offset.y; in tem_adjust_row()
837 tem_row = (tem_y + tems.ts_font.height - 1) / in tem_adjust_row()
838 tems.ts_font.height - 1; in tem_adjust_row()
842 } else if (tem_row >= (tems.ts_c_dimension.height - 1)) { in tem_adjust_row()
848 (tems.ts_c_dimension.height - 1); in tem_adjust_row()
850 tem_row = tems.ts_c_dimension.height - 1; in tem_adjust_row()
949 mutex_enter(&tems.ts_lock); in tem_set_fbmode()
954 mutex_exit(&tems.ts_lock); in tem_set_fbmode()
967 mutex_exit(&tems.ts_lock); in tem_set_fbmode()
975 mutex_enter(&tems.ts_lock); in tem_activate()
976 tems.ts_active = tem; in tem_activate()
987 mutex_exit(&tems.ts_lock); in tem_activate()
996 mutex_enter(&tems.ts_lock); in tem_switch()
1000 tems.ts_active = tobe; in tem_switch()
1013 mutex_exit(&tems.ts_lock); in tem_switch()