Lines Matching refs:vb

47 #define	VTBUF_LOCK(vb)		mtx_lock_spin(&(vb)->vb_lock)  argument
48 #define VTBUF_UNLOCK(vb) mtx_unlock_spin(&(vb)->vb_lock) argument
57 static int vtbuf_htw(const struct vt_buf *vb, int row);
58 static int vtbuf_wth(const struct vt_buf *vb, int row);
71 vthistory_seek(struct vt_buf *vb, int offset, int whence) in vthistory_seek() argument
76 if ((vb->vb_flags & VBF_SCROLL) == 0) { in vthistory_seek()
77 if (vb->vb_roffset != vb->vb_curroffset) { in vthistory_seek()
78 vb->vb_roffset = vb->vb_curroffset; in vthistory_seek()
85 bottom = vb->vb_curroffset; in vthistory_seek()
86 top = (vb->vb_flags & VBF_HISTORY_FULL) ? in vthistory_seek()
87 bottom + vb->vb_scr_size.tp_row - vb->vb_history_size : in vthistory_seek()
102 roffset = vb->vb_roffset; in vthistory_seek()
103 if (roffset >= bottom + vb->vb_scr_size.tp_row) in vthistory_seek()
104 roffset -= vb->vb_history_size; in vthistory_seek()
111 roffset = vb->vb_history_size + roffset; in vthistory_seek()
116 roffset = vb->vb_curroffset; in vthistory_seek()
120 diff = vb->vb_roffset != roffset; in vthistory_seek()
121 vb->vb_roffset = roffset; in vthistory_seek()
127 vthistory_addlines(struct vt_buf *vb, int offset) in vthistory_addlines() argument
133 vb->vb_curroffset += offset; in vthistory_addlines()
134 if (vb->vb_curroffset + vb->vb_scr_size.tp_row >= vb->vb_history_size) { in vthistory_addlines()
135 vb->vb_flags |= VBF_HISTORY_FULL; in vthistory_addlines()
136 vb->vb_curroffset %= vb->vb_history_size; in vthistory_addlines()
138 if ((vb->vb_flags & VBF_SCROLL) == 0) { in vthistory_addlines()
139 vb->vb_roffset = vb->vb_curroffset; in vthistory_addlines()
143 sz = vb->vb_history_size; in vthistory_addlines()
144 cur = vb->vb_roffset + vb->vb_scr_size.tp_row + sz - 1; in vthistory_addlines()
145 if (vtbuf_in_this_range(cur, vb->vb_mark_start.tp_row, cur + offset, sz) || in vthistory_addlines()
146 vtbuf_in_this_range(cur, vb->vb_mark_end.tp_row, cur + offset, sz)) { in vthistory_addlines()
148 vb->vb_mark_start.tp_row = vb->vb_mark_end.tp_row; in vthistory_addlines()
149 vb->vb_mark_start.tp_col = vb->vb_mark_end.tp_col; in vthistory_addlines()
155 vthistory_getpos(const struct vt_buf *vb, unsigned int *offset) in vthistory_getpos() argument
158 *offset = vb->vb_roffset; in vthistory_getpos()
164 vtbuf_htw(const struct vt_buf *vb, int row) in vtbuf_htw() argument
173 return ((row - vb->vb_roffset + vb->vb_history_size) % in vtbuf_htw()
174 vb->vb_history_size); in vtbuf_htw()
179 vtbuf_wth(const struct vt_buf *vb, int row) in vtbuf_wth() argument
182 return ((vb->vb_roffset + row) % vb->vb_history_size); in vtbuf_wth()
209 vtbuf_iscursor(const struct vt_buf *vb, int row, int col) in vtbuf_iscursor() argument
215 if ((vb->vb_flags & (VBF_CURSOR|VBF_SCROLL)) == VBF_CURSOR && in vtbuf_iscursor()
216 (vb->vb_cursor.tp_row == row) && (vb->vb_cursor.tp_col == col)) in vtbuf_iscursor()
221 if (vb->vb_mark_start.tp_col == vb->vb_mark_end.tp_col && in vtbuf_iscursor()
222 vb->vb_mark_start.tp_row == vb->vb_mark_end.tp_row) in vtbuf_iscursor()
225 sc = vb->vb_mark_start.tp_col; in vtbuf_iscursor()
226 sr = vb->vb_mark_start.tp_row; in vtbuf_iscursor()
227 ec = vb->vb_mark_end.tp_col; in vtbuf_iscursor()
228 er = vb->vb_mark_end.tp_row; in vtbuf_iscursor()
235 sz = vb->vb_history_size; in vtbuf_iscursor()
237 row = vtbuf_wth(vb, row); in vtbuf_iscursor()
254 vtbuf_lock(struct vt_buf *vb) in vtbuf_lock() argument
257 VTBUF_LOCK(vb); in vtbuf_lock()
261 vtbuf_unlock(struct vt_buf *vb) in vtbuf_unlock() argument
264 VTBUF_UNLOCK(vb); in vtbuf_unlock()
268 vtbuf_dirty(struct vt_buf *vb, const term_rect_t *area) in vtbuf_dirty() argument
271 if (vb->vb_dirtyrect.tr_begin.tp_row > area->tr_begin.tp_row) in vtbuf_dirty()
272 vb->vb_dirtyrect.tr_begin.tp_row = area->tr_begin.tp_row; in vtbuf_dirty()
273 if (vb->vb_dirtyrect.tr_begin.tp_col > area->tr_begin.tp_col) in vtbuf_dirty()
274 vb->vb_dirtyrect.tr_begin.tp_col = area->tr_begin.tp_col; in vtbuf_dirty()
275 if (vb->vb_dirtyrect.tr_end.tp_row < area->tr_end.tp_row) in vtbuf_dirty()
276 vb->vb_dirtyrect.tr_end.tp_row = area->tr_end.tp_row; in vtbuf_dirty()
277 if (vb->vb_dirtyrect.tr_end.tp_col < area->tr_end.tp_col) in vtbuf_dirty()
278 vb->vb_dirtyrect.tr_end.tp_col = area->tr_end.tp_col; in vtbuf_dirty()
282 vtbuf_dirty_cell(struct vt_buf *vb, const term_pos_t *p) in vtbuf_dirty_cell() argument
289 vtbuf_dirty(vb, &area); in vtbuf_dirty_cell()
293 vtbuf_make_undirty(struct vt_buf *vb) in vtbuf_make_undirty() argument
296 vb->vb_dirtyrect.tr_begin = vb->vb_scr_size; in vtbuf_make_undirty()
297 vb->vb_dirtyrect.tr_end.tp_row = vb->vb_dirtyrect.tr_end.tp_col = 0; in vtbuf_make_undirty()
301 vtbuf_undirty(struct vt_buf *vb, term_rect_t *r) in vtbuf_undirty() argument
304 *r = vb->vb_dirtyrect; in vtbuf_undirty()
305 vtbuf_make_undirty(vb); in vtbuf_undirty()
309 vtbuf_copy(struct vt_buf *vb, const term_rect_t *r, const term_pos_t *p2) in vtbuf_copy() argument
316 KASSERT(r->tr_begin.tp_row < vb->vb_scr_size.tp_row, in vtbuf_copy()
318 r->tr_begin.tp_row, vb->vb_scr_size.tp_row)); in vtbuf_copy()
319 KASSERT(r->tr_begin.tp_col < vb->vb_scr_size.tp_col, in vtbuf_copy()
321 r->tr_begin.tp_col, vb->vb_scr_size.tp_col)); in vtbuf_copy()
323 KASSERT(r->tr_end.tp_row <= vb->vb_scr_size.tp_row, in vtbuf_copy()
325 r->tr_end.tp_row, vb->vb_scr_size.tp_row)); in vtbuf_copy()
326 KASSERT(r->tr_end.tp_col <= vb->vb_scr_size.tp_col, in vtbuf_copy()
328 r->tr_end.tp_col, vb->vb_scr_size.tp_col)); in vtbuf_copy()
330 KASSERT(p2->tp_row < vb->vb_scr_size.tp_row, in vtbuf_copy()
332 p2->tp_row, vb->vb_scr_size.tp_row)); in vtbuf_copy()
333 KASSERT(p2->tp_col < vb->vb_scr_size.tp_col, in vtbuf_copy()
335 p2->tp_col, vb->vb_scr_size.tp_col)); in vtbuf_copy()
341 r->tr_end.tp_col == vb->vb_scr_size.tp_col && /* Full row. */ in vtbuf_copy()
342 (rows + rdiff) == vb->vb_scr_size.tp_row && /* Whole screen. */ in vtbuf_copy()
344 vthistory_addlines(vb, rdiff); in vtbuf_copy()
350 &VTBUF_FIELD(vb, p2->tp_row + pr, p2->tp_col), in vtbuf_copy()
351 &VTBUF_FIELD(vb, p1->tp_row + pr, p1->tp_col), in vtbuf_copy()
357 &VTBUF_FIELD(vb, p2->tp_row + pr, p2->tp_col), in vtbuf_copy()
358 &VTBUF_FIELD(vb, p1->tp_row + pr, p1->tp_col), in vtbuf_copy()
363 area.tr_end.tp_row = MIN(p2->tp_row + rows, vb->vb_scr_size.tp_row); in vtbuf_copy()
364 area.tr_end.tp_col = MIN(p2->tp_col + cols, vb->vb_scr_size.tp_col); in vtbuf_copy()
365 vtbuf_dirty(vb, &area); in vtbuf_copy()
369 vtbuf_do_fill(struct vt_buf *vb, const term_rect_t *r, term_char_t c) in vtbuf_do_fill() argument
375 row = vb->vb_rows[(vb->vb_curroffset + pr) % in vtbuf_do_fill()
376 VTBUF_MAX_HEIGHT(vb)]; in vtbuf_do_fill()
384 vtbuf_fill(struct vt_buf *vb, const term_rect_t *r, term_char_t c) in vtbuf_fill() argument
387 KASSERT(r->tr_begin.tp_row < vb->vb_scr_size.tp_row, in vtbuf_fill()
389 r->tr_begin.tp_row, vb->vb_scr_size.tp_row)); in vtbuf_fill()
390 KASSERT(r->tr_begin.tp_col < vb->vb_scr_size.tp_col, in vtbuf_fill()
392 r->tr_begin.tp_col, vb->vb_scr_size.tp_col)); in vtbuf_fill()
394 KASSERT(r->tr_end.tp_row <= vb->vb_scr_size.tp_row, in vtbuf_fill()
396 r->tr_end.tp_row, vb->vb_scr_size.tp_row)); in vtbuf_fill()
397 KASSERT(r->tr_end.tp_col <= vb->vb_scr_size.tp_col, in vtbuf_fill()
399 r->tr_end.tp_col, vb->vb_scr_size.tp_col)); in vtbuf_fill()
401 vtbuf_do_fill(vb, r, c); in vtbuf_fill()
402 vtbuf_dirty(vb, r); in vtbuf_fill()
406 vtbuf_init_rows(struct vt_buf *vb) in vtbuf_init_rows() argument
410 vb->vb_history_size = MAX(vb->vb_history_size, vb->vb_scr_size.tp_row); in vtbuf_init_rows()
412 for (r = 0; r < vb->vb_history_size; r++) in vtbuf_init_rows()
413 vb->vb_rows[r] = &vb->vb_buffer[r * vb->vb_scr_size.tp_col]; in vtbuf_init_rows()
417 vtbuf_do_clearhistory(struct vt_buf *vb) in vtbuf_do_clearhistory() argument
423 a = teken_get_curattr(&vb->vb_terminal->tm_emulator); in vtbuf_do_clearhistory()
427 rect.tr_end.tp_col = vb->vb_scr_size.tp_col; in vtbuf_do_clearhistory()
428 rect.tr_end.tp_row = vb->vb_history_size; in vtbuf_do_clearhistory()
430 vtbuf_do_fill(vb, &rect, VTBUF_SPACE_CHAR(ch)); in vtbuf_do_clearhistory()
434 vtbuf_reset_scrollback(struct vt_buf *vb) in vtbuf_reset_scrollback() argument
436 vb->vb_roffset = 0; in vtbuf_reset_scrollback()
437 vb->vb_curroffset = 0; in vtbuf_reset_scrollback()
438 vb->vb_mark_start.tp_row = 0; in vtbuf_reset_scrollback()
439 vb->vb_mark_start.tp_col = 0; in vtbuf_reset_scrollback()
440 vb->vb_mark_end.tp_row = 0; in vtbuf_reset_scrollback()
441 vb->vb_mark_end.tp_col = 0; in vtbuf_reset_scrollback()
445 vtbuf_init_early(struct vt_buf *vb) in vtbuf_init_early() argument
447 vb->vb_flags |= VBF_CURSOR; in vtbuf_init_early()
448 vtbuf_reset_scrollback(vb); in vtbuf_init_early()
449 vtbuf_init_rows(vb); in vtbuf_init_early()
450 vtbuf_do_clearhistory(vb); in vtbuf_init_early()
451 vtbuf_make_undirty(vb); in vtbuf_init_early()
452 if ((vb->vb_flags & VBF_MTX_INIT) == 0) { in vtbuf_init_early()
453 mtx_init(&vb->vb_lock, "vtbuf", NULL, MTX_SPIN); in vtbuf_init_early()
454 vb->vb_flags |= VBF_MTX_INIT; in vtbuf_init_early()
459 vtbuf_init(struct vt_buf *vb, const term_pos_t *p) in vtbuf_init() argument
463 vb->vb_scr_size = *p; in vtbuf_init()
464 vb->vb_history_size = VBF_DEFAULT_HISTORY_SIZE; in vtbuf_init()
466 if ((vb->vb_flags & VBF_STATIC) == 0) { in vtbuf_init()
467 sz = vb->vb_history_size * p->tp_col * sizeof(term_char_t); in vtbuf_init()
468 vb->vb_buffer = malloc(sz, M_VTBUF, M_WAITOK | M_ZERO); in vtbuf_init()
470 sz = vb->vb_history_size * sizeof(term_char_t *); in vtbuf_init()
471 vb->vb_rows = malloc(sz, M_VTBUF, M_WAITOK | M_ZERO); in vtbuf_init()
474 vtbuf_init_early(vb); in vtbuf_init()
478 vtbuf_clearhistory(struct vt_buf *vb) in vtbuf_clearhistory() argument
480 VTBUF_LOCK(vb); in vtbuf_clearhistory()
481 vtbuf_do_clearhistory(vb); in vtbuf_clearhistory()
482 vtbuf_reset_scrollback(vb); in vtbuf_clearhistory()
483 vb->vb_flags &= ~VBF_HISTORY_FULL; in vtbuf_clearhistory()
484 VTBUF_UNLOCK(vb); in vtbuf_clearhistory()
488 vtbuf_sethistory_size(struct vt_buf *vb, unsigned int size) in vtbuf_sethistory_size() argument
493 p.tp_row = vb->vb_scr_size.tp_row; in vtbuf_sethistory_size()
494 p.tp_col = vb->vb_scr_size.tp_col; in vtbuf_sethistory_size()
495 vtbuf_grow(vb, &p, size); in vtbuf_sethistory_size()
499 vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, unsigned int history_size) in vtbuf_grow() argument
508 a = teken_get_curattr(&vb->vb_terminal->tm_emulator); in vtbuf_grow()
520 VTBUF_LOCK(vb); in vtbuf_grow()
521 old = vb->vb_flags & VBF_STATIC ? NULL : vb->vb_buffer; in vtbuf_grow()
522 oldrows = vb->vb_flags & VBF_STATIC ? NULL : vb->vb_rows; in vtbuf_grow()
523 copyrows = vb->vb_rows; in vtbuf_grow()
525 w = vb->vb_scr_size.tp_col; in vtbuf_grow()
526 h = vb->vb_scr_size.tp_row; in vtbuf_grow()
527 old_history_size = vb->vb_history_size; in vtbuf_grow()
528 history_full = vb->vb_flags & VBF_HISTORY_FULL || in vtbuf_grow()
529 vb->vb_curroffset + h >= history_size; in vtbuf_grow()
531 vb->vb_history_size = history_size; in vtbuf_grow()
532 vb->vb_buffer = new; in vtbuf_grow()
533 vb->vb_rows = rows; in vtbuf_grow()
534 vb->vb_flags &= ~VBF_STATIC; in vtbuf_grow()
535 vb->vb_scr_size = *p; in vtbuf_grow()
536 vtbuf_init_rows(vb); in vtbuf_grow()
556 (vb->vb_curroffset + h + r) % in vtbuf_grow()
588 vb->vb_flags &= ~VBF_HISTORY_FULL; in vtbuf_grow()
601 vb->vb_curroffset = old_history_size - h; in vtbuf_grow()
618 (vb->vb_curroffset + h + r + in vtbuf_grow()
638 vb->vb_curroffset = history_size - h; in vtbuf_grow()
639 vb->vb_flags |= VBF_HISTORY_FULL; in vtbuf_grow()
643 vb->vb_roffset = vb->vb_curroffset; in vtbuf_grow()
646 if (vb->vb_cursor.tp_col > p->tp_col - 1) in vtbuf_grow()
651 vb->vb_cursor.tp_col = p->tp_col - 1; in vtbuf_grow()
653 if (vb->vb_curroffset > 0 || vb->vb_cursor.tp_row > p->tp_row - 1) in vtbuf_grow()
655 vb->vb_cursor.tp_row = p->tp_row - 1; in vtbuf_grow()
657 VTBUF_UNLOCK(vb); in vtbuf_grow()
665 vtbuf_putchar(struct vt_buf *vb, const term_pos_t *p, term_char_t c) in vtbuf_putchar() argument
669 KASSERT(p->tp_row < vb->vb_scr_size.tp_row, in vtbuf_putchar()
671 p->tp_row, vb->vb_scr_size.tp_row)); in vtbuf_putchar()
672 KASSERT(p->tp_col < vb->vb_scr_size.tp_col, in vtbuf_putchar()
674 p->tp_col, vb->vb_scr_size.tp_col)); in vtbuf_putchar()
676 row = vb->vb_rows[(vb->vb_curroffset + p->tp_row) % in vtbuf_putchar()
677 VTBUF_MAX_HEIGHT(vb)]; in vtbuf_putchar()
680 vtbuf_dirty_cell(vb, p); in vtbuf_putchar()
685 vtbuf_cursor_position(struct vt_buf *vb, const term_pos_t *p) in vtbuf_cursor_position() argument
687 if (vb->vb_flags & VBF_CURSOR) { in vtbuf_cursor_position()
688 vtbuf_dirty_cell(vb, &vb->vb_cursor); in vtbuf_cursor_position()
689 vb->vb_cursor = *p; in vtbuf_cursor_position()
690 vtbuf_dirty_cell(vb, &vb->vb_cursor); in vtbuf_cursor_position()
692 vb->vb_cursor = *p; in vtbuf_cursor_position()
698 vtbuf_flush_mark(struct vt_buf *vb) in vtbuf_flush_mark() argument
704 if ((vb->vb_mark_start.tp_col != vb->vb_mark_end.tp_col) || in vtbuf_flush_mark()
705 (vb->vb_mark_start.tp_row != vb->vb_mark_end.tp_row)) { in vtbuf_flush_mark()
706 s = vtbuf_htw(vb, vb->vb_mark_start.tp_row); in vtbuf_flush_mark()
707 e = vtbuf_htw(vb, vb->vb_mark_end.tp_row); in vtbuf_flush_mark()
712 area.tr_end.tp_col = vb->vb_scr_size.tp_col; in vtbuf_flush_mark()
715 VTBUF_LOCK(vb); in vtbuf_flush_mark()
716 vtbuf_dirty(vb, &area); in vtbuf_flush_mark()
717 VTBUF_UNLOCK(vb); in vtbuf_flush_mark()
722 vtbuf_get_marked_len(struct vt_buf *vb) in vtbuf_get_marked_len() argument
728 if (POS_INDEX(vtbuf_htw(vb, vb->vb_mark_start.tp_row), in vtbuf_get_marked_len()
729 vb->vb_mark_start.tp_col) > in vtbuf_get_marked_len()
730 POS_INDEX(vtbuf_htw(vb, vb->vb_mark_end.tp_row), in vtbuf_get_marked_len()
731 vb->vb_mark_end.tp_col)) { in vtbuf_get_marked_len()
732 POS_COPY(e, vb->vb_mark_start); in vtbuf_get_marked_len()
733 POS_COPY(s, vb->vb_mark_end); in vtbuf_get_marked_len()
735 POS_COPY(s, vb->vb_mark_start); in vtbuf_get_marked_len()
736 POS_COPY(e, vb->vb_mark_end); in vtbuf_get_marked_len()
739 si = s.tp_row * vb->vb_scr_size.tp_col + s.tp_col; in vtbuf_get_marked_len()
740 ei = e.tp_row * vb->vb_scr_size.tp_col + e.tp_col; in vtbuf_get_marked_len()
772 vtbuf_extract_marked(struct vt_buf *vb, term_char_t *buf, int sz, int mark) in vtbuf_extract_marked() argument
778 if (POS_INDEX(vtbuf_htw(vb, vb->vb_mark_start.tp_row), in vtbuf_extract_marked()
779 vb->vb_mark_start.tp_col) > in vtbuf_extract_marked()
780 POS_INDEX(vtbuf_htw(vb, vb->vb_mark_end.tp_row), in vtbuf_extract_marked()
781 vb->vb_mark_end.tp_col)) { in vtbuf_extract_marked()
782 POS_COPY(e, vb->vb_mark_start); in vtbuf_extract_marked()
783 POS_COPY(s, vb->vb_mark_end); in vtbuf_extract_marked()
785 POS_COPY(s, vb->vb_mark_start); in vtbuf_extract_marked()
786 POS_COPY(e, vb->vb_mark_end); in vtbuf_extract_marked()
792 ce = (r == e.tp_row)?e.tp_col:vb->vb_scr_size.tp_col; in vtbuf_extract_marked()
797 buf[i++] = vb->vb_rows[r][c]; in vtbuf_extract_marked()
818 vtbuf_set_mark(struct vt_buf *vb, int type, int col, int row) in vtbuf_set_mark() argument
825 if (vb->vb_mark_last != VTB_MARK_MOVE) in vtbuf_set_mark()
830 vtbuf_flush_mark(vb); /* Clean old mark. */ in vtbuf_set_mark()
831 vb->vb_mark_end.tp_col = col; in vtbuf_set_mark()
832 vb->vb_mark_end.tp_row = vtbuf_wth(vb, row); in vtbuf_set_mark()
835 vtbuf_flush_mark(vb); /* Clean old mark. */ in vtbuf_set_mark()
836 vb->vb_mark_start.tp_col = col; in vtbuf_set_mark()
837 vb->vb_mark_start.tp_row = vtbuf_wth(vb, row); in vtbuf_set_mark()
839 vb->vb_mark_end.tp_col = col; in vtbuf_set_mark()
840 vb->vb_mark_end.tp_row = vtbuf_wth(vb, row); in vtbuf_set_mark()
843 vtbuf_flush_mark(vb); /* Clean old mark. */ in vtbuf_set_mark()
844 vb->vb_mark_start.tp_row = vb->vb_mark_end.tp_row = in vtbuf_set_mark()
845 vtbuf_wth(vb, row); in vtbuf_set_mark()
846 r = vb->vb_rows[vb->vb_mark_start.tp_row]; in vtbuf_set_mark()
849 vb->vb_mark_start.tp_col = i + 1; in vtbuf_set_mark()
855 vb->vb_mark_start.tp_col = 0; in vtbuf_set_mark()
856 for (i = col; i < vb->vb_scr_size.tp_col; i++) { in vtbuf_set_mark()
858 vb->vb_mark_end.tp_col = i; in vtbuf_set_mark()
863 if (i == vb->vb_scr_size.tp_col) in vtbuf_set_mark()
864 vb->vb_mark_end.tp_col = i; in vtbuf_set_mark()
866 if (vb->vb_mark_start.tp_col > vb->vb_mark_end.tp_col) in vtbuf_set_mark()
867 vb->vb_mark_start.tp_col = vb->vb_mark_end.tp_col; in vtbuf_set_mark()
870 vtbuf_flush_mark(vb); /* Clean old mark. */ in vtbuf_set_mark()
871 vb->vb_mark_start.tp_col = 0; in vtbuf_set_mark()
872 vb->vb_mark_end.tp_col = vb->vb_scr_size.tp_col; in vtbuf_set_mark()
873 vb->vb_mark_start.tp_row = vb->vb_mark_end.tp_row = in vtbuf_set_mark()
874 vtbuf_wth(vb, row); in vtbuf_set_mark()
877 vb->vb_mark_last = type; in vtbuf_set_mark()
884 vb->vb_mark_last = type; in vtbuf_set_mark()
886 vtbuf_flush_mark(vb); in vtbuf_set_mark()
892 vtbuf_cursor_visibility(struct vt_buf *vb, int yes) in vtbuf_cursor_visibility() argument
896 oflags = vb->vb_flags; in vtbuf_cursor_visibility()
898 vb->vb_flags |= VBF_CURSOR; in vtbuf_cursor_visibility()
900 vb->vb_flags &= ~VBF_CURSOR; in vtbuf_cursor_visibility()
901 nflags = vb->vb_flags; in vtbuf_cursor_visibility()
904 vtbuf_dirty_cell(vb, &vb->vb_cursor); in vtbuf_cursor_visibility()
908 vtbuf_scroll_mode(struct vt_buf *vb, int yes) in vtbuf_scroll_mode() argument
912 VTBUF_LOCK(vb); in vtbuf_scroll_mode()
913 oflags = vb->vb_flags; in vtbuf_scroll_mode()
915 vb->vb_flags |= VBF_SCROLL; in vtbuf_scroll_mode()
917 vb->vb_flags &= ~VBF_SCROLL; in vtbuf_scroll_mode()
918 nflags = vb->vb_flags; in vtbuf_scroll_mode()
921 vtbuf_dirty_cell(vb, &vb->vb_cursor); in vtbuf_scroll_mode()
922 VTBUF_UNLOCK(vb); in vtbuf_scroll_mode()