1 #include <linux/slab.h>
4 #include <linux/sched.h>
11 #define ishardspace(c) ((c) == ' ')
19 static int sel_start = -1;
21 static int sel_buffer_lth;
22 static char *sel_buffer;
24 static unsigned char sel_pos(
int n)
36 static int atedge(
const int p,
int size_row)
38 return !(p % size_row) || !((p + 2) % size_row);
42 static unsigned short limit(
const unsigned short v,
const unsigned short u)
44 return (v > u) ? u :
v;
49 int new_sel_start, new_sel_end;
72 "Selection: mark console not the same as cut\n");
80 if (new_sel_end > new_sel_start &&
83 for (pe = new_sel_end + 2; ; pe += 2)
90 if ((new_sel_start == sel_start) && (new_sel_end == sel_end))
93 sel_start = new_sel_start;
94 sel_end = new_sel_end;
98 dev_warn(tty->
dev,
"selection: kmalloc() failed\n");
106 for (i = sel_start; i <= sel_end; i += 2) {
120 sel_buffer_lth = bp - sel_buffer;
129 int pasted = 0,
count;
132 while (sel_buffer && sel_buffer_lth > pasted) {
141 count = sel_buffer_lth - pasted;
143 tty->
ldisc->ops->receive_buf(tty, sel_buffer + pasted,