History

vt: convert vc_tab_stop to bitmap

vc_tab_stop is used as a bitmap, but defined as an unsigned int array. Switch it to bitmap and convert all users to the bitmap interface. Note the difference in behavior! We no longer mask the top 24 bits away from x, hence we do not wrap tabs at 256th column. Instead, we silently drop attempts to set a tab behind 256 columns. And we will also seek by '\t' to the rightmost column, when behind that boundary. I do not think the original behavior was desired and that someone relies on that. If this turns out to be the case, we can change the added 'if's back to masks here and there instead... (Or we can increase the limit as fb consoles now have 240 chars here. And they could have more with higher than my resolution, of course.)

Jiri Slaby committed 6 years ago

Commit dbee4cf1 parent b70ec4d2 files · +20 −27Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/console_struct.h+2−1
@@ -21,6 +21,7 @@ struct uni_pagedir; · 20 unmodified lines
21struct uni_screen;21struct uni_screen;
22 22
23#define NPAR 1623#define NPAR 16
24#define VC_TABSTOPS_COUNT 256U
24 25
25enum vc_intensity {26enum vc_intensity {
26 VCI_HALF_BRIGHT,27 VCI_HALF_BRIGHT,
@@ -147,7 +148,7 @@ struct vc_data { · 120 unmodified lines
147 unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */148 unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */
148 unsigned char vc_utf_count;149 unsigned char vc_utf_count;
149 int vc_utf_char;150 int vc_utf_char;
150 unsigned int vc_tab_stop[8]; /* Tab stops. 256 columns. */151 DECLARE_BITMAP(vc_tab_stop, VC_TABSTOPS_COUNT); /* Tab stops. 256 columns. */
151 unsigned char vc_palette[16*3]; /* Colour palette for VGA+ */152 unsigned char vc_palette[16*3]; /* Colour palette for VGA+ */
152 unsigned short * vc_translate;153 unsigned short * vc_translate;
153 unsigned int vc_resize_user; /* resize request from user */154 unsigned int vc_resize_user; /* resize request from user */