| .. | .. |
|---|
| 21 | 21 | struct uni_screen; |
|---|
| 22 | 22 | |
|---|
| 23 | 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 | 63 | * Example: vc_data of a console that was scrolled 3 lines down. |
|---|
| .. | .. |
|---|
| 57 | 94 | struct vc_data { |
|---|
| 58 | 95 | struct tty_port port; /* Upper level data */ |
|---|
| 59 | 96 | |
|---|
| 97 | + struct vc_state state, saved_state; |
|---|
| 98 | + |
|---|
| 60 | 99 | unsigned short vc_num; /* Console number */ |
|---|
| 61 | 100 | unsigned int vc_cols; /* [#] Console size */ |
|---|
| 62 | 101 | unsigned int vc_rows; |
|---|
| .. | .. |
|---|
| 74 | 113 | /* attributes for all characters on screen */ |
|---|
| 75 | 114 | unsigned char vc_attr; /* Current attributes */ |
|---|
| 76 | 115 | unsigned char vc_def_color; /* Default colors */ |
|---|
| 77 | | - unsigned char vc_color; /* Foreground & background */ |
|---|
| 78 | | - unsigned char vc_s_color; /* Saved foreground & background */ |
|---|
| 79 | 116 | unsigned char vc_ulcolor; /* Color for underline mode */ |
|---|
| 80 | 117 | unsigned char vc_itcolor; |
|---|
| 81 | 118 | unsigned char vc_halfcolor; /* Color for half intensity mode */ |
|---|
| .. | .. |
|---|
| 83 | 120 | unsigned int vc_cursor_type; |
|---|
| 84 | 121 | unsigned short vc_complement_mask; /* [#] Xor mask for mouse pointer */ |
|---|
| 85 | 122 | unsigned short vc_s_complement_mask; /* Saved mouse pointer mask */ |
|---|
| 86 | | - unsigned int vc_x, vc_y; /* Cursor position */ |
|---|
| 87 | | - unsigned int vc_saved_x, vc_saved_y; |
|---|
| 88 | 123 | unsigned long vc_pos; /* Cursor address */ |
|---|
| 89 | 124 | /* fonts */ |
|---|
| 90 | 125 | unsigned short vc_hi_font_mask; /* [#] Attribute set for upper 256 chars of font or 0 if not supported */ |
|---|
| .. | .. |
|---|
| 99 | 134 | int vt_newvt; |
|---|
| 100 | 135 | wait_queue_head_t paste_wait; |
|---|
| 101 | 136 | /* mode flags */ |
|---|
| 102 | | - unsigned int vc_charset : 1; /* Character set G0 / G1 */ |
|---|
| 103 | | - unsigned int vc_s_charset : 1; /* Saved character set */ |
|---|
| 104 | 137 | unsigned int vc_disp_ctrl : 1; /* Display chars < 32? */ |
|---|
| 105 | 138 | unsigned int vc_toggle_meta : 1; /* Toggle high bit? */ |
|---|
| 106 | 139 | unsigned int vc_decscnm : 1; /* Screen Mode */ |
|---|
| .. | .. |
|---|
| 108 | 141 | unsigned int vc_decawm : 1; /* Autowrap Mode */ |
|---|
| 109 | 142 | unsigned int vc_deccm : 1; /* Cursor Visible */ |
|---|
| 110 | 143 | unsigned int vc_decim : 1; /* Insert Mode */ |
|---|
| 111 | | - /* attribute flags */ |
|---|
| 112 | | - unsigned int vc_intensity : 2; /* 0=half-bright, 1=normal, 2=bold */ |
|---|
| 113 | | - unsigned int vc_italic:1; |
|---|
| 114 | | - unsigned int vc_underline : 1; |
|---|
| 115 | | - unsigned int vc_blink : 1; |
|---|
| 116 | | - unsigned int vc_reverse : 1; |
|---|
| 117 | | - unsigned int vc_s_intensity : 2; /* saved rendition */ |
|---|
| 118 | | - unsigned int vc_s_italic:1; |
|---|
| 119 | | - unsigned int vc_s_underline : 1; |
|---|
| 120 | | - unsigned int vc_s_blink : 1; |
|---|
| 121 | | - unsigned int vc_s_reverse : 1; |
|---|
| 122 | 144 | /* misc */ |
|---|
| 123 | | - unsigned int vc_ques : 1; |
|---|
| 145 | + unsigned int vc_priv : 3; |
|---|
| 124 | 146 | unsigned int vc_need_wrap : 1; |
|---|
| 125 | 147 | unsigned int vc_can_do_color : 1; |
|---|
| 126 | 148 | unsigned int vc_report_mouse : 2; |
|---|
| 127 | 149 | unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */ |
|---|
| 128 | 150 | unsigned char vc_utf_count; |
|---|
| 129 | 151 | int vc_utf_char; |
|---|
| 130 | | - unsigned int vc_tab_stop[8]; /* Tab stops. 256 columns. */ |
|---|
| 152 | + DECLARE_BITMAP(vc_tab_stop, VC_TABSTOPS_COUNT); /* Tab stops. 256 columns. */ |
|---|
| 131 | 153 | unsigned char vc_palette[16*3]; /* Colour palette for VGA+ */ |
|---|
| 132 | 154 | unsigned short * vc_translate; |
|---|
| 133 | | - unsigned char vc_G0_charset; |
|---|
| 134 | | - unsigned char vc_G1_charset; |
|---|
| 135 | | - unsigned char vc_saved_G0; |
|---|
| 136 | | - unsigned char vc_saved_G1; |
|---|
| 137 | 155 | unsigned int vc_resize_user; /* resize request from user */ |
|---|
| 138 | 156 | unsigned int vc_bell_pitch; /* Console bell pitch */ |
|---|
| 139 | 157 | unsigned int vc_bell_duration; /* Console bell duration */ |
|---|
| .. | .. |
|---|
| 142 | 160 | struct uni_pagedir *vc_uni_pagedir; |
|---|
| 143 | 161 | struct uni_pagedir **vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */ |
|---|
| 144 | 162 | struct uni_screen *vc_uni_screen; /* unicode screen content */ |
|---|
| 145 | | - bool vc_panic_force_write; /* when oops/panic this VC can accept forced output/blanking */ |
|---|
| 146 | 163 | /* additional information is in vt_kern.h */ |
|---|
| 147 | 164 | }; |
|---|
| 148 | 165 | |
|---|
| .. | .. |
|---|
| 151 | 168 | struct work_struct SAK_work; |
|---|
| 152 | 169 | |
|---|
| 153 | 170 | /* might add scrmem, kbd at some time, |
|---|
| 154 | | - to have everything in one place - the disadvantage |
|---|
| 155 | | - would be that vc_cons etc can no longer be static */ |
|---|
| 171 | + to have everything in one place */ |
|---|
| 156 | 172 | }; |
|---|
| 157 | 173 | |
|---|
| 158 | 174 | extern struct vc vc_cons [MAX_NR_CONSOLES]; |
|---|
| 159 | 175 | extern void vc_SAK(struct work_struct *work); |
|---|
| 160 | 176 | |
|---|
| 161 | | -#define CUR_DEF 0 |
|---|
| 162 | | -#define CUR_NONE 1 |
|---|
| 163 | | -#define CUR_UNDERLINE 2 |
|---|
| 164 | | -#define CUR_LOWER_THIRD 3 |
|---|
| 165 | | -#define CUR_LOWER_HALF 4 |
|---|
| 166 | | -#define CUR_TWO_THIRDS 5 |
|---|
| 167 | | -#define CUR_BLOCK 6 |
|---|
| 168 | | -#define CUR_HWMASK 0x0f |
|---|
| 169 | | -#define CUR_SWMASK 0xfff0 |
|---|
| 177 | +#define CUR_MAKE(size, change, set) ((size) | ((change) << 8) | \ |
|---|
| 178 | + ((set) << 16)) |
|---|
| 179 | +#define CUR_SIZE(c) ((c) & 0x00000f) |
|---|
| 180 | +# define CUR_DEF 0 |
|---|
| 181 | +# define CUR_NONE 1 |
|---|
| 182 | +# define CUR_UNDERLINE 2 |
|---|
| 183 | +# define CUR_LOWER_THIRD 3 |
|---|
| 184 | +# define CUR_LOWER_HALF 4 |
|---|
| 185 | +# define CUR_TWO_THIRDS 5 |
|---|
| 186 | +# define CUR_BLOCK 6 |
|---|
| 187 | +#define CUR_SW 0x000010 |
|---|
| 188 | +#define CUR_ALWAYS_BG 0x000020 |
|---|
| 189 | +#define CUR_INVERT_FG_BG 0x000040 |
|---|
| 190 | +#define CUR_FG 0x000700 |
|---|
| 191 | +#define CUR_BG 0x007000 |
|---|
| 192 | +#define CUR_CHANGE(c) ((c) & 0x00ff00) |
|---|
| 193 | +#define CUR_SET(c) (((c) & 0xff0000) >> 8) |
|---|
| 170 | 194 | |
|---|
| 171 | | -#define CUR_DEFAULT CUR_UNDERLINE |
|---|
| 172 | | - |
|---|
| 173 | | -static inline bool con_is_visible(const struct vc_data *vc) |
|---|
| 174 | | -{ |
|---|
| 175 | | - return *vc->vc_display_fg == vc; |
|---|
| 176 | | -} |
|---|
| 195 | +bool con_is_visible(const struct vc_data *vc); |
|---|
| 177 | 196 | |
|---|
| 178 | 197 | #endif /* _LINUX_CONSOLE_STRUCT_H */ |
|---|