1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef _LINUX_CONSOLE_STRUCT_H
14#define _LINUX_CONSOLE_STRUCT_H
15
16#include <linux/wait.h>
17#include <linux/vt.h>
18#include <linux/workqueue.h>
19
20struct uni_pagedir;
21struct uni_screen;
22
23#define NPAR 16
24#define VC_TABSTOPS_COUNT 256U
25
26enum vc_intensity {
27 VCI_HALF_BRIGHT,
28 VCI_NORMAL,
29 VCI_BOLD,
30 VCI_MASK = 0x3,
31};
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46struct vc_state {
47 unsigned int x, y;
48
49 unsigned char color;
50
51 unsigned char Gx_charset[2];
52 unsigned int charset : 1;
53
54
55 enum vc_intensity intensity;
56 bool italic;
57 bool underline;
58 bool blink;
59 bool reverse;
60};
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94struct vc_data {
95 struct tty_port port;
96
97 struct vc_state state, saved_state;
98
99 unsigned short vc_num;
100 unsigned int vc_cols;
101 unsigned int vc_rows;
102 unsigned int vc_size_row;
103 unsigned int vc_scan_lines;
104 unsigned long vc_origin;
105 unsigned long vc_scr_end;
106 unsigned long vc_visible_origin;
107 unsigned int vc_top, vc_bottom;
108 const struct consw *vc_sw;
109 unsigned short *vc_screenbuf;
110 unsigned int vc_screenbuf_size;
111 unsigned char vc_mode;
112
113 unsigned char vc_attr;
114 unsigned char vc_def_color;
115 unsigned char vc_ulcolor;
116 unsigned char vc_itcolor;
117 unsigned char vc_halfcolor;
118
119 unsigned int vc_cursor_type;
120 unsigned short vc_complement_mask;
121 unsigned short vc_s_complement_mask;
122 unsigned long vc_pos;
123
124 unsigned short vc_hi_font_mask;
125 struct console_font vc_font;
126 unsigned short vc_video_erase_char;
127
128 unsigned int vc_state;
129 unsigned int vc_npar,vc_par[NPAR];
130
131 struct vt_mode vt_mode;
132 struct pid *vt_pid;
133 int vt_newvt;
134 wait_queue_head_t paste_wait;
135
136 unsigned int vc_disp_ctrl : 1;
137 unsigned int vc_toggle_meta : 1;
138 unsigned int vc_decscnm : 1;
139 unsigned int vc_decom : 1;
140 unsigned int vc_decawm : 1;
141 unsigned int vc_deccm : 1;
142 unsigned int vc_decim : 1;
143
144 unsigned int vc_priv : 3;
145 unsigned int vc_need_wrap : 1;
146 unsigned int vc_can_do_color : 1;
147 unsigned int vc_report_mouse : 2;
148 unsigned char vc_utf : 1;
149 unsigned char vc_utf_count;
150 int vc_utf_char;
151 DECLARE_BITMAP(vc_tab_stop, VC_TABSTOPS_COUNT);
152 unsigned char vc_palette[16*3];
153 unsigned short * vc_translate;
154 unsigned int vc_resize_user;
155 unsigned int vc_bell_pitch;
156 unsigned int vc_bell_duration;
157 unsigned short vc_cur_blink_ms;
158 struct vc_data **vc_display_fg;
159 struct uni_pagedir *vc_uni_pagedir;
160 struct uni_pagedir **vc_uni_pagedir_loc;
161 struct uni_screen *vc_uni_screen;
162
163};
164
165struct vc {
166 struct vc_data *d;
167 struct work_struct SAK_work;
168
169
170
171};
172
173extern struct vc vc_cons [MAX_NR_CONSOLES];
174extern void vc_SAK(struct work_struct *work);
175
176#define CUR_MAKE(size, change, set) ((size) | ((change) << 8) | \
177 ((set) << 16))
178#define CUR_SIZE(c) ((c) & 0x00000f)
179# define CUR_DEF 0
180# define CUR_NONE 1
181# define CUR_UNDERLINE 2
182# define CUR_LOWER_THIRD 3
183# define CUR_LOWER_HALF 4
184# define CUR_TWO_THIRDS 5
185# define CUR_BLOCK 6
186#define CUR_SW 0x000010
187#define CUR_ALWAYS_BG 0x000020
188#define CUR_INVERT_FG_BG 0x000040
189#define CUR_FG 0x000700
190#define CUR_BG 0x007000
191#define CUR_CHANGE(c) ((c) & 0x00ff00)
192#define CUR_SET(c) (((c) & 0xff0000) >> 8)
193
194bool con_is_visible(const struct vc_data *vc);
195
196#endif
197