| @@ -21,6 +21,43 @@ struct uni_pagedir; · 20 unmodified lines |
| 21 | struct uni_screen; | 21 | struct uni_screen; |
| 22 | | 22 | |
| 23 | #define NPAR 16 | 23 | #define NPAR 16 |
| | 24 | #define VC_TABSTOPS_COUNT 256U |
| | 25 | |
| | 26 | enum vc_intensity { |
| | 27 | VCI_HALF_BRIGHT, |
| | 28 | VCI_NORMAL, |
| | 29 | VCI_BOLD, |
| | 30 | VCI_MASK = 0x3, |
| | 31 | }; |
| | 32 | |
| | 33 | /** |
| | 34 | * struct vc_state -- state of a VC |
| | 35 | * @x: cursor's x-position |
| | 36 | * @y: cursor's y-position |
| | 37 | * @color: foreground & background colors |
| | 38 | * @Gx_charset: what's G0/G1 slot set to (like GRAF_MAP, LAT1_MAP) |
| | 39 | * @charset: what character set to use (0=G0 or 1=G1) |
| | 40 | * @intensity: see enum vc_intensity for values |
| | 41 | * @reverse: reversed foreground/background colors |
| | 42 | * |
| | 43 | * These members are defined separately from struct vc_data as we save & |
| | 44 | * restore them at times. |
| | 45 | */ |
| | 46 | struct 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 | /* attribute flags */ |
| | 55 | enum vc_intensity intensity; |
| | 56 | bool italic; |
| | 57 | bool underline; |
| | 58 | bool blink; |
| | 59 | bool reverse; |
| | 60 | }; |
| 24 | | 61 | |
| 25 | /* | 62 | /* |
| 26 | * Example: vc_data of a console that was scrolled 3 lines down. | 63 | * Example: vc_data of a console that was scrolled 3 lines down. |
| @@ -57,6 +94,8 @@ struct uni_screen; · 30 unmodified lines |
| 57 | struct vc_data { | 94 | struct vc_data { |
| 58 | struct tty_port port; /* Upper level data */ | 95 | struct tty_port port; /* Upper level data */ |
| 59 | | 96 | |
| | 97 | struct vc_state state, saved_state; |
| | 98 | |
| 60 | unsigned short vc_num; /* Console number */ | 99 | unsigned short vc_num; /* Console number */ |
| 61 | unsigned int vc_cols; /* [#] Console size */ | 100 | unsigned int vc_cols; /* [#] Console size */ |
| 62 | unsigned int vc_rows; | 101 | unsigned int vc_rows; |
| @@ -73,8 +112,6 @@ struct vc_data { · 10 unmodified lines |
| 73 | /* attributes for all characters on screen */ | 112 | /* attributes for all characters on screen */ |
| 74 | unsigned char vc_attr; /* Current attributes */ | 113 | unsigned char vc_attr; /* Current attributes */ |
| 75 | unsigned char vc_def_color; /* Default colors */ | 114 | unsigned char vc_def_color; /* Default colors */ |
| 76 | unsigned char vc_color; /* Foreground & background */ | | |
| 77 | unsigned char vc_s_color; /* Saved foreground & background */ | | |
| 78 | unsigned char vc_ulcolor; /* Color for underline mode */ | 115 | unsigned char vc_ulcolor; /* Color for underline mode */ |
| 79 | unsigned char vc_itcolor; | 116 | unsigned char vc_itcolor; |
| 80 | unsigned char vc_halfcolor; /* Color for half intensity mode */ | 117 | unsigned char vc_halfcolor; /* Color for half intensity mode */ |
| @@ -82,8 +119,6 @@ struct vc_data { · 1 unmodified line |
| 82 | unsigned int vc_cursor_type; | 119 | unsigned int vc_cursor_type; |
| 83 | unsigned short vc_complement_mask; /* [#] Xor mask for mouse pointer */ | 120 | unsigned short vc_complement_mask; /* [#] Xor mask for mouse pointer */ |
| 84 | unsigned short vc_s_complement_mask; /* Saved mouse pointer mask */ | 121 | unsigned short vc_s_complement_mask; /* Saved mouse pointer mask */ |
| 85 | unsigned int vc_x, vc_y; /* Cursor position */ | | |
| 86 | unsigned int vc_saved_x, vc_saved_y; | | |
| 87 | unsigned long vc_pos; /* Cursor address */ | 122 | unsigned long vc_pos; /* Cursor address */ |
| 88 | /* fonts */ | 123 | /* fonts */ |
| 89 | unsigned short vc_hi_font_mask; /* [#] Attribute set for upper 256 chars of font or 0 if not supported */ | 124 | unsigned short vc_hi_font_mask; /* [#] Attribute set for upper 256 chars of font or 0 if not supported */ |
| @@ -98,8 +133,6 @@ struct vc_data { · 8 unmodified lines |
| 98 | int vt_newvt; | 133 | int vt_newvt; |
| 99 | wait_queue_head_t paste_wait; | 134 | wait_queue_head_t paste_wait; |
| 100 | /* mode flags */ | 135 | /* mode flags */ |
| 101 | unsigned int vc_charset : 1; /* Character set G0 / G1 */ | | |
| 102 | unsigned int vc_s_charset : 1; /* Saved character set */ | | |
| 103 | unsigned int vc_disp_ctrl : 1; /* Display chars < 32? */ | 136 | unsigned int vc_disp_ctrl : 1; /* Display chars < 32? */ |
| 104 | unsigned int vc_toggle_meta : 1; /* Toggle high bit? */ | 137 | unsigned int vc_toggle_meta : 1; /* Toggle high bit? */ |
| 105 | unsigned int vc_decscnm : 1; /* Screen Mode */ | 138 | unsigned int vc_decscnm : 1; /* Screen Mode */ |
| @@ -107,17 +140,6 @@ struct vc_data { · 1 unmodified line |
| 107 | unsigned int vc_decawm : 1; /* Autowrap Mode */ | 140 | unsigned int vc_decawm : 1; /* Autowrap Mode */ |
| 108 | unsigned int vc_deccm : 1; /* Cursor Visible */ | 141 | unsigned int vc_deccm : 1; /* Cursor Visible */ |
| 109 | unsigned int vc_decim : 1; /* Insert Mode */ | 142 | unsigned int vc_decim : 1; /* Insert Mode */ |
| 110 | /* attribute flags */ | | |
| 111 | unsigned int vc_intensity : 2; /* 0=half-bright, 1=normal, 2=bold */ | | |
| 112 | unsigned int vc_italic:1; | | |
| 113 | unsigned int vc_underline : 1; | | |
| 114 | unsigned int vc_blink : 1; | | |
| 115 | unsigned int vc_reverse : 1; | | |
| 116 | unsigned int vc_s_intensity : 2; /* saved rendition */ | | |
| 117 | unsigned int vc_s_italic:1; | | |
| 118 | unsigned int vc_s_underline : 1; | | |
| 119 | unsigned int vc_s_blink : 1; | | |
| 120 | unsigned int vc_s_reverse : 1; | | |
| 121 | /* misc */ | 143 | /* misc */ |
| 122 | unsigned int vc_priv : 3; | 144 | unsigned int vc_priv : 3; |
| 123 | unsigned int vc_need_wrap : 1; | 145 | unsigned int vc_need_wrap : 1; |
| @@ -126,13 +148,9 @@ struct vc_data { · 2 unmodified lines |
| 126 | unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */ | 148 | unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */ |
| 127 | unsigned char vc_utf_count; | 149 | unsigned char vc_utf_count; |
| 128 | int vc_utf_char; | 150 | int vc_utf_char; |
| 129 | unsigned int vc_tab_stop[8]; /* Tab stops. 256 columns. */ | 151 | DECLARE_BITMAP(vc_tab_stop, VC_TABSTOPS_COUNT); /* Tab stops. 256 columns. */ |
| 130 | unsigned char vc_palette[16*3]; /* Colour palette for VGA+ */ | 152 | unsigned char vc_palette[16*3]; /* Colour palette for VGA+ */ |
| 131 | unsigned short * vc_translate; | 153 | unsigned short * vc_translate; |
| 132 | unsigned char vc_G0_charset; | | |
| 133 | unsigned char vc_G1_charset; | | |
| 134 | unsigned char vc_saved_G0; | | |
| 135 | unsigned char vc_saved_G1; | | |
| 136 | unsigned int vc_resize_user; /* resize request from user */ | 154 | unsigned int vc_resize_user; /* resize request from user */ |
| 137 | unsigned int vc_bell_pitch; /* Console bell pitch */ | 155 | unsigned int vc_bell_pitch; /* Console bell pitch */ |
| 138 | unsigned int vc_bell_duration; /* Console bell duration */ | 156 | unsigned int vc_bell_duration; /* Console bell duration */ |
| @@ -149,24 +167,29 @@ struct vc { · 10 unmodified lines |
| 149 | struct work_struct SAK_work; | 167 | struct work_struct SAK_work; |
| 150 | | 168 | |
| 151 | /* might add scrmem, kbd at some time, | 169 | /* might add scrmem, kbd at some time, |
| 152 | to have everything in one place - the disadvantage | 170 | to have everything in one place */ |
| 153 | would be that vc_cons etc can no longer be static */ | | |
| 154 | }; | 171 | }; |
| 155 | | 172 | |
| 156 | extern struct vc vc_cons [MAX_NR_CONSOLES]; | 173 | extern struct vc vc_cons [MAX_NR_CONSOLES]; |
| 157 | extern void vc_SAK(struct work_struct *work); | 174 | extern void vc_SAK(struct work_struct *work); |
| 158 | | 175 | |
| 159 | #define CUR_DEF 0 | 176 | #define CUR_MAKE(size, change, set) ((size) | ((change) << 8) | \ |
| 160 | #define CUR_NONE 1 | 177 | ((set) << 16)) |
| 161 | #define CUR_UNDERLINE 2 | 178 | #define CUR_SIZE(c) ((c) & 0x00000f) |
| 162 | #define CUR_LOWER_THIRD 3 | 179 | # define CUR_DEF 0 |
| 163 | #define CUR_LOWER_HALF 4 | 180 | # define CUR_NONE 1 |
| 164 | #define CUR_TWO_THIRDS 5 | 181 | # define CUR_UNDERLINE 2 |
| 165 | #define CUR_BLOCK 6 | 182 | # define CUR_LOWER_THIRD 3 |
| 166 | #define CUR_HWMASK 0x0f | 183 | # define CUR_LOWER_HALF 4 |
| 167 | #define CUR_SWMASK 0xfff0 | 184 | # define CUR_TWO_THIRDS 5 |
| 168 | | 185 | # define CUR_BLOCK 6 |
| 169 | #define CUR_DEFAULT CUR_UNDERLINE | 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) |
| 170 | | 193 | |
| 171 | bool con_is_visible(const struct vc_data *vc); | 194 | bool con_is_visible(const struct vc_data *vc); |
| 172 | | 195 | |