Lines Matching defs:tems

113 tem_state_t	tems;	/* common term info */
114 _NOTE(MUTEX_PROTECTS_DATA(tems.ts_lock, tems))
140 mutex_init(&tems.ts_lock, (char *)NULL, MUTEX_DRIVER, NULL);
141 list_create(&tems.ts_list, sizeof (struct tem_vt_state),
143 tems.ts_active = NULL;
170 ASSERT(MUTEX_HELD(&tems.ts_lock) && MUTEX_HELD(&tem->tvs_lock));
172 list_insert_head(&tems.ts_list, tem);
178 ASSERT(MUTEX_HELD(&tems.ts_lock) && MUTEX_HELD(&tem->tvs_lock));
180 list_remove(&tems.ts_list, tem);
192 mutex_enter(&tems.ts_lock);
197 mutex_exit(&tems.ts_lock);
205 mutex_exit(&tems.ts_lock);
219 ASSERT(MUTEX_HELD(&tems.ts_lock) && MUTEX_HELD(&ptem->tvs_lock));
221 if (tems.ts_display_mode == VIS_PIXEL) {
222 ptem->tvs_pix_data_size = tems.ts_pix_data_size;
227 ptem->tvs_outbuf_size = tems.ts_c_dimension.width;
231 width = tems.ts_c_dimension.width;
232 height = tems.ts_c_dimension.height;
278 mutex_enter(&tems.ts_lock);
291 if (!tems.ts_initialized) {
297 mutex_exit(&tems.ts_lock);
304 mutex_exit(&tems.ts_lock);
316 ASSERT(MUTEX_HELD(&tems.ts_lock) && MUTEX_HELD(&tem->tvs_lock));
346 mutex_enter(&tems.ts_lock);
355 if (tems.ts_active == tem)
356 tems.ts_active = NULL;
359 mutex_exit(&tems.ts_lock);
369 ASSERT(MUTEX_HELD(&tems.ts_lock));
372 (void) ldi_ioctl(tems.ts_hdl, VIS_DEVFINI, 0,
375 (void) ldi_close(tems.ts_hdl, NULL, credp);
376 tems.ts_hdl = NULL;
393 mutex_enter(&tems.ts_lock);
395 if (tems.ts_initialized) {
396 mutex_exit(&tems.ts_lock);
411 mutex_exit(&tems.ts_lock);
415 &tems.ts_hdl, term_li) != 0) {
419 mutex_exit(&tems.ts_lock);
430 if (ldi_ioctl(tems.ts_hdl, VIS_DEVINIT,
434 mutex_exit(&tems.ts_lock);
444 mutex_exit(&tems.ts_lock);
448 if ((tems.ts_fb_polledio = temargs.polledio) == NULL) {
452 mutex_exit(&tems.ts_lock);
461 mutex_exit(&tems.ts_lock);
468 mutex_exit(&tems.ts_lock);
481 tems_get_initial_color(&tems.ts_init_color);
483 tems.ts_initialized = 1; /* initialization flag */
485 for (p = list_head(&tems.ts_list); p != NULL;
486 p = list_next(&tems.ts_list, p)) {
494 mutex_exit(&tems.ts_lock);
506 if (tems.ts_pdepth != tp->depth)
510 if (tems.ts_c_dimension.width != tp->width ||
511 tems.ts_c_dimension.height != tp->height)
514 if (tems.ts_p_dimension.width != tp->width ||
515 tems.ts_p_dimension.height != tp->height)
526 int old_blank_buf_size = tems.ts_c_dimension.width;
528 ASSERT(MUTEX_HELD(&tems.ts_lock));
530 tems.ts_pdepth = tp->depth;
531 tems.ts_linebytes = tp->linebytes;
532 tems.ts_display_mode = tp->mode;
536 tems.ts_p_dimension.width = 0;
537 tems.ts_p_dimension.height = 0;
538 tems.ts_c_dimension.width = tp->width;
539 tems.ts_c_dimension.height = tp->height;
540 tems.ts_callbacks = &tem_safe_text_callbacks;
553 tems.ts_c_dimension.height = (screen_size_t)height;
554 tems.ts_c_dimension.width = (screen_size_t)width;
556 tems.ts_p_dimension.height = tp->height;
557 tems.ts_p_dimension.width = tp->width;
559 tems.ts_callbacks = &tem_safe_pix_callbacks;
568 set_font(&tems.ts_font,
569 &tems.ts_c_dimension.height,
570 &tems.ts_c_dimension.width,
571 tems.ts_p_dimension.height,
572 tems.ts_p_dimension.width);
574 tems.ts_p_offset.y = (tems.ts_p_dimension.height -
575 (tems.ts_c_dimension.height * tems.ts_font.height)) / 2;
576 tems.ts_p_offset.x = (tems.ts_p_dimension.width -
577 (tems.ts_c_dimension.width * tems.ts_font.width)) / 2;
579 tems.ts_pix_data_size =
580 tems.ts_font.width * tems.ts_font.height;
582 tems.ts_pix_data_size *= 4;
584 tems.ts_pdepth = tp->depth;
590 if (tems.ts_blank_line)
591 kmem_free(tems.ts_blank_line, old_blank_buf_size);
593 tems.ts_blank_line = (unsigned char *)
594 kmem_alloc(tems.ts_c_dimension.width, KM_SLEEP);
595 for (i = 0; i < tems.ts_c_dimension.width; i++)
596 tems.ts_blank_line[i] = ' ';
621 ASSERT(!(list_is_empty(&tems.ts_list)));
623 mutex_enter(&tems.ts_lock);
630 mutex_exit(&tems.ts_lock);
640 struct tem_vt_state *active = tems.ts_active;
641 tems.ts_pdepth = devinit->depth;
648 mutex_exit(&tems.ts_lock);
652 tems_setup_terminal(devinit, tems.ts_c_dimension.height,
653 tems.ts_c_dimension.width);
655 for (p = list_head(&tems.ts_list); p != NULL;
656 p = list_next(&tems.ts_list, p)) {
663 if (tems.ts_modechg_cb == NULL) {
664 mutex_exit(&tems.ts_lock);
668 cb = tems.ts_modechg_cb;
669 cb_arg = tems.ts_modechg_arg;
674 mutex_exit(&tems.ts_lock);
690 (void) ldi_ioctl(tems.ts_hdl, VIS_CONSDISPLAY,
707 (void) ldi_ioctl(tems.ts_hdl, VIS_CONSCOPY,
722 (void) ldi_ioctl(tems.ts_hdl, VIS_CONSCURSOR,
731 (void) ldi_ioctl(tems.ts_hdl, KDSETMODE,
745 switch (tems.ts_pdepth) {
752 (void) ldi_ioctl(tems.ts_hdl, VIS_PUTCMAP, (intptr_t)&cm,
761 mutex_enter(&tems.ts_lock);
762 *r = (ushort_t)tems.ts_c_dimension.height;
763 *c = (ushort_t)tems.ts_c_dimension.width;
764 *x = (ushort_t)tems.ts_p_dimension.width;
765 *y = (ushort_t)tems.ts_p_dimension.height;
766 mutex_exit(&tems.ts_lock);
772 mutex_enter(&tems.ts_lock);
774 tems.ts_modechg_cb = func;
775 tems.ts_modechg_arg = arg;
777 mutex_exit(&tems.ts_lock);
792 ma.s_row = nrows * tems.ts_font.height;
793 ma.e_row = tems.ts_p_dimension.height - 1;
797 ma.e_col = tems.ts_p_dimension.width - 1;
803 width = tems.ts_font.width;
804 ncols = (tems.ts_p_dimension.width + (width - 1))/ width;
806 tem_safe_pix_cls_range(tem, 0, nrows, tems.ts_p_offset.y,
834 tems.ts_p_offset.y;
835 tem_row = (tem_y + tems.ts_font.height - 1) /
836 tems.ts_font.height - 1;
840 } else if (tem_row >= (tems.ts_c_dimension.height - 1)) {
846 (tems.ts_c_dimension.height - 1);
848 tem_row = tems.ts_c_dimension.height - 1;
963 mutex_enter(&tems.ts_lock);
968 mutex_exit(&tems.ts_lock);
981 mutex_exit(&tems.ts_lock);
989 mutex_enter(&tems.ts_lock);
990 tems.ts_active = tem;
1001 mutex_exit(&tems.ts_lock);
1010 mutex_enter(&tems.ts_lock);
1014 tems.ts_active = tobe;
1027 mutex_exit(&tems.ts_lock);