aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kbd_kern.h
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-02-28 09:49:23 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-08 13:50:35 -0500
commit079c9534a96da9a85a2a2f9715851050fbfbf749 (patch)
tree0e3782ff6d341f38c6f0b3840cb3c8f2bc922df8 /include/linux/kbd_kern.h
parent0fb8379dab9f97e4c56de8f9ea772c10eda27561 (diff)
vt:tackle kbd_table
Keyboard struct lifetime is easy, but the locking is not and is completely ignored by the existing code. Tackle this one head on - Make the kbd_table private so we can run down all direct users - Hoick the relevant ioctl handlers into the keyboard layer - Lock them with the keyboard lock so they don't change mid keypress - Add helpers for things like console stop/start so we isolate the poking around properly - Tweak the braille console so it still builds There are a couple of FIXME locking cases left for ioctls that are so hideous they should be addressed in a later patch. After this patch the kbd_table is private and all the keyboard jiggery pokery is in one place. This update fixes speakup and also a memory leak in the original. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/kbd_kern.h')
-rw-r--r--include/linux/kbd_kern.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index ec2d17bc1f1e..daf4a3a40ee0 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -7,8 +7,6 @@
7 7
8extern struct tasklet_struct keyboard_tasklet; 8extern struct tasklet_struct keyboard_tasklet;
9 9
10extern int shift_state;
11
12extern char *func_table[MAX_NR_FUNC]; 10extern char *func_table[MAX_NR_FUNC];
13extern char func_buf[]; 11extern char func_buf[];
14extern char *funcbufptr; 12extern char *funcbufptr;
@@ -65,8 +63,6 @@ struct kbd_struct {
65#define VC_META 4 /* 0 - meta, 1 - meta=prefix with ESC */ 63#define VC_META 4 /* 0 - meta, 1 - meta=prefix with ESC */
66}; 64};
67 65
68extern struct kbd_struct kbd_table[];
69
70extern int kbd_init(void); 66extern int kbd_init(void);
71 67
72extern unsigned char getledstate(void); 68extern unsigned char getledstate(void);
@@ -79,6 +75,7 @@ extern void (*kbd_ledfunc)(unsigned int led);
79extern int set_console(int nr); 75extern int set_console(int nr);
80extern void schedule_console_callback(void); 76extern void schedule_console_callback(void);
81 77
78/* FIXME: review locking for vt.c callers */
82static inline void set_leds(void) 79static inline void set_leds(void)
83{ 80{
84 tasklet_schedule(&keyboard_tasklet); 81 tasklet_schedule(&keyboard_tasklet);
@@ -142,8 +139,6 @@ static inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag)
142 139
143struct console; 140struct console;
144 141
145int getkeycode(unsigned int scancode);
146int setkeycode(unsigned int scancode, unsigned int keycode);
147void compute_shiftstate(void); 142void compute_shiftstate(void);
148 143
149/* defkeymap.c */ 144/* defkeymap.c */