summaryrefslogtreecommitdiffstats
path: root/include/linux/selection.h
diff options
context:
space:
mode:
authorOkash Khawaja <okash.khawaja@gmail.com>2019-04-17 08:21:13 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-19 09:09:10 -0400
commit496124e5e16e4974c71404bc9ddaa016156f8cb0 (patch)
tree44fdfdd19c83589f60a4acb5489cbe0a783f80e9 /include/linux/selection.h
parent827c085baede48155c57dff16396620c5377e755 (diff)
vt: selection: allow functions to be called from inside kernel
This patch breaks set_selection() into two functions so that when called from kernel, copy_from_user() can be avoided. The two functions are called set_selection_user() and set_selection_kernel() in order to be explicit about their purposes. This also means updating any references to set_selection() and fixing for name change. It also exports set_selection_kernel() and paste_selection(). These changes are used the following patch where speakup's selection functionality calls into the above functions, thereby doing away with parallel implementation. Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Tested-by: Gregory Nowak <greg@gregn.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/selection.h')
-rw-r--r--include/linux/selection.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/selection.h b/include/linux/selection.h
index a8f5b97b216f..e2c1f96bf059 100644
--- a/include/linux/selection.h
+++ b/include/linux/selection.h
@@ -11,13 +11,14 @@
11#include <linux/tiocl.h> 11#include <linux/tiocl.h>
12#include <linux/vt_buffer.h> 12#include <linux/vt_buffer.h>
13 13
14struct tty_struct;
15
16extern struct vc_data *sel_cons; 14extern struct vc_data *sel_cons;
17struct tty_struct; 15struct tty_struct;
18 16
19extern void clear_selection(void); 17extern void clear_selection(void);
20extern int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty); 18extern int set_selection_user(const struct tiocl_selection __user *sel,
19 struct tty_struct *tty);
20extern int set_selection_kernel(struct tiocl_selection *v,
21 struct tty_struct *tty);
21extern int paste_selection(struct tty_struct *tty); 22extern int paste_selection(struct tty_struct *tty);
22extern int sel_loadlut(char __user *p); 23extern int sel_loadlut(char __user *p);
23extern int mouse_reporting(void); 24extern int mouse_reporting(void);