Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/vt/vt_buf.c
Show First 20 Lines • Show All 427 Lines • ▼ Show 20 Lines | vtbuf_do_clearhistory(struct vt_buf *vb) | ||||
rect.tr_begin.tp_row = rect.tr_begin.tp_col = 0; | rect.tr_begin.tp_row = rect.tr_begin.tp_col = 0; | ||||
rect.tr_end.tp_col = vb->vb_scr_size.tp_col; | rect.tr_end.tp_col = vb->vb_scr_size.tp_col; | ||||
rect.tr_end.tp_row = vb->vb_history_size; | rect.tr_end.tp_row = vb->vb_history_size; | ||||
vtbuf_do_fill(vb, &rect, VTBUF_SPACE_CHAR(ch)); | vtbuf_do_fill(vb, &rect, VTBUF_SPACE_CHAR(ch)); | ||||
} | } | ||||
void | static void | ||||
vtbuf_init_early(struct vt_buf *vb) | vtbuf_reset_scrollback(struct vt_buf *vb) | ||||
{ | { | ||||
vb->vb_flags |= VBF_CURSOR; | |||||
vb->vb_roffset = 0; | vb->vb_roffset = 0; | ||||
vb->vb_curroffset = 0; | vb->vb_curroffset = 0; | ||||
vb->vb_mark_start.tp_row = 0; | vb->vb_mark_start.tp_row = 0; | ||||
vb->vb_mark_start.tp_col = 0; | vb->vb_mark_start.tp_col = 0; | ||||
vb->vb_mark_end.tp_row = 0; | vb->vb_mark_end.tp_row = 0; | ||||
vb->vb_mark_end.tp_col = 0; | vb->vb_mark_end.tp_col = 0; | ||||
} | |||||
void | |||||
vtbuf_init_early(struct vt_buf *vb) | |||||
{ | |||||
vb->vb_flags |= VBF_CURSOR; | |||||
vtbuf_reset_scrollback(vb); | |||||
vtbuf_init_rows(vb); | vtbuf_init_rows(vb); | ||||
vtbuf_do_clearhistory(vb); | vtbuf_do_clearhistory(vb); | ||||
vtbuf_make_undirty(vb); | vtbuf_make_undirty(vb); | ||||
if ((vb->vb_flags & VBF_MTX_INIT) == 0) { | if ((vb->vb_flags & VBF_MTX_INIT) == 0) { | ||||
mtx_init(&vb->vb_lock, "vtbuf", NULL, MTX_SPIN); | mtx_init(&vb->vb_lock, "vtbuf", NULL, MTX_SPIN); | ||||
vb->vb_flags |= VBF_MTX_INIT; | vb->vb_flags |= VBF_MTX_INIT; | ||||
} | } | ||||
} | } | ||||
Show All 17 Lines | vtbuf_init(struct vt_buf *vb, const term_pos_t *p) | ||||
vtbuf_init_early(vb); | vtbuf_init_early(vb); | ||||
} | } | ||||
void | void | ||||
vtbuf_clearhistory(struct vt_buf *vb) | vtbuf_clearhistory(struct vt_buf *vb) | ||||
{ | { | ||||
VTBUF_LOCK(vb); | VTBUF_LOCK(vb); | ||||
vtbuf_do_clearhistory(vb); | vtbuf_do_clearhistory(vb); | ||||
vtbuf_reset_scrollback(vb); | |||||
vb->vb_flags &= ~VBF_HISTORY_FULL; | |||||
VTBUF_UNLOCK(vb); | VTBUF_UNLOCK(vb); | ||||
} | } | ||||
void | void | ||||
vtbuf_sethistory_size(struct vt_buf *vb, unsigned int size) | vtbuf_sethistory_size(struct vt_buf *vb, unsigned int size) | ||||
{ | { | ||||
term_pos_t p; | term_pos_t p; | ||||
▲ Show 20 Lines • Show All 390 Lines • Show Last 20 Lines |