OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [arch/] [armnommu/] [drivers/] [char/] [kbd_kern.h] - Blame information for rev 1775

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
#ifndef _KBD_KERN_H
2
#define _KBD_KERN_H
3
 
4
#include <linux/interrupt.h>
5
#include <linux/keyboard.h>
6
 
7
extern int shift_state;
8
extern char *func_table[MAX_NR_FUNC];
9
extern char func_buf[];
10
extern char *funcbufptr;
11
extern int funcbufsize, funcbufleft;
12
 
13
#ifndef _VT_KERN_H
14
#include "vt_kern.h"
15
#endif
16
 
17
extern void compute_shiftstate (void);
18
extern int kbd_struct_init (struct vt *vt, int init);
19
extern int kbd_ioctl (struct vt *vt, int cmd, unsigned long arg);
20
extern int kbd_init (void);
21
 
22
/*
23
 * kbd->xxx contains the VC-local things (flag settings etc..)
24
 *
25
 * Note: externally visible are LED_SCR, LED_NUM, LED_CAP defined in kd.h
26
 *       The code in KDGETLED / KDSETLED depends on the internal and
27
 *       external order being the same.
28
 *
29
 * Note: lockstate is used as index in the array key_map.
30
 */
31
struct kbd_struct {
32
 
33
        unsigned char lockstate;
34
/* 8 modifiers - the names do not have any meaning at all;
35
   they can be associated to arbitrarily chosen keys */
36
#define VC_SHIFTLOCK    KG_SHIFT        /* shift lock mode */
37
#define VC_ALTGRLOCK    KG_ALTGR        /* altgr lock mode */
38
#define VC_CTRLLOCK     KG_CTRL         /* control lock mode */
39
#define VC_ALTLOCK      KG_ALT          /* alt lock mode */
40
#define VC_SHIFTLLOCK   KG_SHIFTL       /* shiftl lock mode */
41
#define VC_SHIFTRLOCK   KG_SHIFTR       /* shiftr lock mode */
42
#define VC_CTRLLLOCK    KG_CTRLL        /* ctrll lock mode */
43
#define VC_CTRLRLOCK    KG_CTRLR        /* ctrlr lock mode */
44
        unsigned char slockstate;       /* for `sticky' Shift, Ctrl, etc. */
45
 
46
        unsigned char ledmode:2;        /* one 2-bit value */
47
#define LED_SHOW_FLAGS 0        /* traditional state */
48
#define LED_SHOW_IOCTL 1        /* only change leds upon ioctl */
49
#define LED_SHOW_MEM 2          /* `heartbeat': peek into memory */
50
 
51
        unsigned char ledflagstate:3;   /* flags, not lights */
52
        unsigned char default_ledflagstate:3;
53
#define VC_SCROLLOCK    0        /* scroll-lock mode */
54
#define VC_NUMLOCK      1       /* numeric lock mode */
55
#define VC_CAPSLOCK     2       /* capslock mode */
56
 
57
        unsigned char kbdmode:2;        /* one 2-bit value */
58
#define VC_XLATE        0        /* translate keycodes using keymap */
59
#define VC_MEDIUMRAW    1       /* medium raw (keycode) mode */
60
#define VC_RAW          2       /* raw (scancode) mode */
61
#define VC_UNICODE      3       /* Unicode mode */
62
 
63
        unsigned char modeflags:5;
64
#define VC_APPLIC       0        /* application key mode */
65
#define VC_CKMODE       1       /* cursor key mode */
66
#define VC_REPEAT       2       /* keyboard repeat */
67
#define VC_CRLF         3       /* 0 - enter sends CR, 1 - enter sends CRLF */
68
#define VC_META         4       /* 0 - meta, 1 - meta=prefix with ESC */
69
};
70
 
71
extern unsigned char getledstate(void);
72
extern void setledstate(struct kbd_struct *kbd, unsigned int led);
73
 
74
extern int do_poke_blanked_console;
75
extern struct vt *want_console;
76
extern struct vt *last_console;
77
 
78
extern inline void show_console(void)
79
{
80
        do_poke_blanked_console = 1;
81
        mark_bh(CONSOLE_BH);
82
}
83
 
84
extern inline void set_console(struct vt *vt)
85
{
86
        want_console = vt;
87
        mark_bh(CONSOLE_BH);
88
}
89
 
90
extern inline void set_leds(void)
91
{
92
        mark_bh(KEYBOARD_BH);
93
}
94
 
95
extern inline int vc_kbd_mode(struct kbd_struct * kbd, int flag)
96
{
97
        return ((kbd->modeflags >> flag) & 1);
98
}
99
 
100
extern inline int vc_kbd_led(struct kbd_struct * kbd, int flag)
101
{
102
        return ((kbd->ledflagstate >> flag) & 1);
103
}
104
 
105
extern inline void set_vc_kbd_mode(struct kbd_struct * kbd, int flag)
106
{
107
        kbd->modeflags |= 1 << flag;
108
}
109
 
110
extern inline void set_vc_kbd_led(struct kbd_struct * kbd, int flag)
111
{
112
        kbd->ledflagstate |= 1 << flag;
113
}
114
 
115
extern inline void clr_vc_kbd_mode(struct kbd_struct * kbd, int flag)
116
{
117
        kbd->modeflags &= ~(1 << flag);
118
}
119
 
120
extern inline void clr_vc_kbd_led(struct kbd_struct * kbd, int flag)
121
{
122
        kbd->ledflagstate &= ~(1 << flag);
123
}
124
 
125
extern inline void chg_vc_kbd_lock(struct kbd_struct * kbd, int flag)
126
{
127
        kbd->lockstate ^= 1 << flag;
128
}
129
 
130
extern inline void chg_vc_kbd_slock(struct kbd_struct * kbd, int flag)
131
{
132
        kbd->slockstate ^= 1 << flag;
133
}
134
 
135
extern inline void chg_vc_kbd_mode(struct kbd_struct * kbd, int flag)
136
{
137
        kbd->modeflags ^= 1 << flag;
138
}
139
 
140
extern inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag)
141
{
142
        kbd->ledflagstate ^= 1 << flag;
143
}
144
 
145
#define U(x) ((x) ^ 0xf000)
146
 
147
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.