Lines Matching refs:vc_sel
46 } vc_sel = { variable
47 .lock = __MUTEX_INITIALIZER(vc_sel.lock),
57 invert_screen(vc_sel.cons, s, e-s+2, true); in highlight()
63 complement_pos(vc_sel.cons, where); in highlight_pointer()
70 return screen_glyph_unicode(vc_sel.cons, n / 2); in sel_pos()
71 return inverse_translate(vc_sel.cons, screen_glyph(vc_sel.cons, n), in sel_pos()
86 if (vc_sel.start != -1) { in clear_selection()
87 highlight(vc_sel.start, vc_sel.end); in clear_selection()
88 vc_sel.start = -1; in clear_selection()
95 return vc == vc_sel.cons; in vc_is_sel()
217 bp = kmalloc_array((vc_sel.end - vc_sel.start) / 2 + 1, unicode ? 4 : 1, in vc_selection_store_chars()
224 kfree(vc_sel.buffer); in vc_selection_store_chars()
225 vc_sel.buffer = bp; in vc_selection_store_chars()
228 for (i = vc_sel.start; i <= vc_sel.end; i += 2) { in vc_selection_store_chars()
246 vc_sel.buf_len = bp - vc_sel.buffer; in vc_selection_store_chars()
309 if (vc_sel.start == -1) /* no current selection */ in vc_do_selection()
311 else if (new_sel_start == vc_sel.start) in vc_do_selection()
313 if (new_sel_end == vc_sel.end) /* no action required */ in vc_do_selection()
315 else if (new_sel_end > vc_sel.end) /* extend to right */ in vc_do_selection()
316 highlight(vc_sel.end + 2, new_sel_end); in vc_do_selection()
318 highlight(new_sel_end + 2, vc_sel.end); in vc_do_selection()
320 else if (new_sel_end == vc_sel.end) in vc_do_selection()
322 if (new_sel_start < vc_sel.start) /* extend to left */ in vc_do_selection()
323 highlight(new_sel_start, vc_sel.start - 2); in vc_do_selection()
325 highlight(vc_sel.start, new_sel_start - 2); in vc_do_selection()
332 vc_sel.start = new_sel_start; in vc_do_selection()
333 vc_sel.end = new_sel_end; in vc_do_selection()
368 if (vc_sel.cons != vc) { in vc_selection()
370 vc_sel.cons = vc; in vc_selection()
378 guard(mutex)(&vc_sel.lock); in set_selection_kernel()
415 mutex_lock(&vc_sel.lock); in paste_selection()
416 while (vc_sel.buffer && (vc_sel.buf_len > pasted || bpe)) { in paste_selection()
423 mutex_unlock(&vc_sel.lock); in paste_selection()
425 mutex_lock(&vc_sel.lock); in paste_selection()
437 count = vc_sel.buf_len - pasted; in paste_selection()
439 pasted += tty_ldisc_receive_buf(ld, vc_sel.buffer + pasted, in paste_selection()
441 if (vc_sel.buf_len > pasted) in paste_selection()
451 mutex_unlock(&vc_sel.lock); in paste_selection()