aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@novell.com>2005-09-13 04:25:44 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-13 11:22:32 -0400
commit2f4516dbd048f25eba78e115e8e73e1e8f04e7f9 (patch)
treee803f2b6c128aee352f00455547417752e9f9114 /drivers
parente703ecc3bfbe10f478500798c0c5826d00ad9fe3 (diff)
[PATCH] fbcon: constify font data
const-ify the font control structures and data, to make somewhat better guarantees that these are not modified anywhere in the kernel. Specifically for a kernel debugger to share this information from the normal kernel code, such a guarantee seems rather desirable. Signed-off-by: Jan Beulich <jbeulich@novell.com> Cc: "Antonino A. Daplas" <adaplas@hotpop.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/console/fbcon.c16
-rw-r--r--drivers/video/console/fbcon.h2
-rw-r--r--drivers/video/console/font_10x18.c4
-rw-r--r--drivers/video/console/font_6x11.c4
-rw-r--r--drivers/video/console/font_7x14.c4
-rw-r--r--drivers/video/console/font_8x16.c4
-rw-r--r--drivers/video/console/font_8x8.c4
-rw-r--r--drivers/video/console/font_acorn_8x8.c4
-rw-r--r--drivers/video/console/font_mini_4x6.c4
-rw-r--r--drivers/video/console/font_pearl_8x8.c4
-rw-r--r--drivers/video/console/font_sun12x22.c4
-rw-r--r--drivers/video/console/font_sun8x16.c4
-rw-r--r--drivers/video/console/fonts.c9
13 files changed, 33 insertions, 34 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index a7b4a52f41f9..0fc8bb499c3f 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -767,7 +767,7 @@ static const char *fbcon_startup(void)
767 const char *display_desc = "frame buffer device"; 767 const char *display_desc = "frame buffer device";
768 struct display *p = &fb_display[fg_console]; 768 struct display *p = &fb_display[fg_console];
769 struct vc_data *vc = vc_cons[fg_console].d; 769 struct vc_data *vc = vc_cons[fg_console].d;
770 struct font_desc *font = NULL; 770 const struct font_desc *font = NULL;
771 struct module *owner; 771 struct module *owner;
772 struct fb_info *info = NULL; 772 struct fb_info *info = NULL;
773 struct fbcon_ops *ops; 773 struct fbcon_ops *ops;
@@ -841,7 +841,7 @@ static const char *fbcon_startup(void)
841 info->var.yres); 841 info->var.yres);
842 vc->vc_font.width = font->width; 842 vc->vc_font.width = font->width;
843 vc->vc_font.height = font->height; 843 vc->vc_font.height = font->height;
844 vc->vc_font.data = p->fontdata = font->data; 844 vc->vc_font.data = (void *)(p->fontdata = font->data);
845 vc->vc_font.charcount = 256; /* FIXME Need to support more fonts */ 845 vc->vc_font.charcount = 256; /* FIXME Need to support more fonts */
846 } 846 }
847 847
@@ -941,7 +941,7 @@ static void fbcon_init(struct vc_data *vc, int init)
941 fb, copy the font from that console */ 941 fb, copy the font from that console */
942 t = &fb_display[svc->vc_num]; 942 t = &fb_display[svc->vc_num];
943 if (!vc->vc_font.data) { 943 if (!vc->vc_font.data) {
944 vc->vc_font.data = p->fontdata = t->fontdata; 944 vc->vc_font.data = (void *)(p->fontdata = t->fontdata);
945 vc->vc_font.width = (*default_mode)->vc_font.width; 945 vc->vc_font.width = (*default_mode)->vc_font.width;
946 vc->vc_font.height = (*default_mode)->vc_font.height; 946 vc->vc_font.height = (*default_mode)->vc_font.height;
947 p->userfont = t->userfont; 947 p->userfont = t->userfont;
@@ -1188,7 +1188,7 @@ static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var,
1188 return; 1188 return;
1189 t = &fb_display[svc->vc_num]; 1189 t = &fb_display[svc->vc_num];
1190 if (!vc->vc_font.data) { 1190 if (!vc->vc_font.data) {
1191 vc->vc_font.data = p->fontdata = t->fontdata; 1191 vc->vc_font.data = (void *)(p->fontdata = t->fontdata);
1192 vc->vc_font.width = (*default_mode)->vc_font.width; 1192 vc->vc_font.width = (*default_mode)->vc_font.width;
1193 vc->vc_font.height = (*default_mode)->vc_font.height; 1193 vc->vc_font.height = (*default_mode)->vc_font.height;
1194 p->userfont = t->userfont; 1194 p->userfont = t->userfont;
@@ -2150,7 +2150,7 @@ static int fbcon_get_font(struct vc_data *vc, struct console_font *font)
2150} 2150}
2151 2151
2152static int fbcon_do_set_font(struct vc_data *vc, int w, int h, 2152static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
2153 u8 * data, int userfont) 2153 const u8 * data, int userfont)
2154{ 2154{
2155 struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; 2155 struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
2156 struct display *p = &fb_display[vc->vc_num]; 2156 struct display *p = &fb_display[vc->vc_num];
@@ -2168,7 +2168,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
2168 cnt = FNTCHARCNT(data); 2168 cnt = FNTCHARCNT(data);
2169 else 2169 else
2170 cnt = 256; 2170 cnt = 256;
2171 vc->vc_font.data = p->fontdata = data; 2171 vc->vc_font.data = (void *)(p->fontdata = data);
2172 if ((p->userfont = userfont)) 2172 if ((p->userfont = userfont))
2173 REFCOUNT(data)++; 2173 REFCOUNT(data)++;
2174 vc->vc_font.width = w; 2174 vc->vc_font.width = w;
@@ -2325,7 +2325,7 @@ static int fbcon_set_font(struct vc_data *vc, struct console_font *font, unsigne
2325 tmp->vc_font.width == w && 2325 tmp->vc_font.width == w &&
2326 !memcmp(fb_display[i].fontdata, new_data, size)) { 2326 !memcmp(fb_display[i].fontdata, new_data, size)) {
2327 kfree(new_data - FONT_EXTRA_WORDS * sizeof(int)); 2327 kfree(new_data - FONT_EXTRA_WORDS * sizeof(int));
2328 new_data = fb_display[i].fontdata; 2328 new_data = (u8 *)fb_display[i].fontdata;
2329 break; 2329 break;
2330 } 2330 }
2331 } 2331 }
@@ -2335,7 +2335,7 @@ static int fbcon_set_font(struct vc_data *vc, struct console_font *font, unsigne
2335static int fbcon_set_def_font(struct vc_data *vc, struct console_font *font, char *name) 2335static int fbcon_set_def_font(struct vc_data *vc, struct console_font *font, char *name)
2336{ 2336{
2337 struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; 2337 struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
2338 struct font_desc *f; 2338 const struct font_desc *f;
2339 2339
2340 if (!name) 2340 if (!name)
2341 f = get_default_font(info->var.xres, info->var.yres); 2341 f = get_default_font(info->var.xres, info->var.yres);
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
index 08befafe11d1..0738cd62def2 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -30,7 +30,7 @@ struct display {
30 /* Filled in by the frame buffer device */ 30 /* Filled in by the frame buffer device */
31 u_short inverse; /* != 0 text black on white as default */ 31 u_short inverse; /* != 0 text black on white as default */
32 /* Filled in by the low-level console driver */ 32 /* Filled in by the low-level console driver */
33 u_char *fontdata; 33 const u_char *fontdata;
34 int userfont; /* != 0 if fontdata kmalloc()ed */ 34 int userfont; /* != 0 if fontdata kmalloc()ed */
35 u_short scrollmode; /* Scroll Method */ 35 u_short scrollmode; /* Scroll Method */
36 short yscroll; /* Hardware scrolling */ 36 short yscroll; /* Hardware scrolling */
diff --git a/drivers/video/console/font_10x18.c b/drivers/video/console/font_10x18.c
index ff0af96e4dfc..e6aa0eab5bb6 100644
--- a/drivers/video/console/font_10x18.c
+++ b/drivers/video/console/font_10x18.c
@@ -7,7 +7,7 @@
7 7
8#define FONTDATAMAX 9216 8#define FONTDATAMAX 9216
9 9
10static unsigned char fontdata_10x18[FONTDATAMAX] = { 10static const unsigned char fontdata_10x18[FONTDATAMAX] = {
11 11
12 /* 0 0x00 '^@' */ 12 /* 0 0x00 '^@' */
13 0x00, 0x00, /* 0000000000 */ 13 0x00, 0x00, /* 0000000000 */
@@ -5132,7 +5132,7 @@ static unsigned char fontdata_10x18[FONTDATAMAX] = {
5132}; 5132};
5133 5133
5134 5134
5135struct font_desc font_10x18 = { 5135const struct font_desc font_10x18 = {
5136 FONT10x18_IDX, 5136 FONT10x18_IDX,
5137 "10x18", 5137 "10x18",
5138 10, 5138 10,
diff --git a/drivers/video/console/font_6x11.c b/drivers/video/console/font_6x11.c
index c52f1294044a..89976cd97494 100644
--- a/drivers/video/console/font_6x11.c
+++ b/drivers/video/console/font_6x11.c
@@ -8,7 +8,7 @@
8 8
9#define FONTDATAMAX (11*256) 9#define FONTDATAMAX (11*256)
10 10
11static unsigned char fontdata_6x11[FONTDATAMAX] = { 11static const unsigned char fontdata_6x11[FONTDATAMAX] = {
12 12
13 /* 0 0x00 '^@' */ 13 /* 0 0x00 '^@' */
14 0x00, /* 00000000 */ 14 0x00, /* 00000000 */
@@ -3341,7 +3341,7 @@ static unsigned char fontdata_6x11[FONTDATAMAX] = {
3341}; 3341};
3342 3342
3343 3343
3344struct font_desc font_vga_6x11 = { 3344const struct font_desc font_vga_6x11 = {
3345 VGA6x11_IDX, 3345 VGA6x11_IDX,
3346 "ProFont6x11", 3346 "ProFont6x11",
3347 6, 3347 6,
diff --git a/drivers/video/console/font_7x14.c b/drivers/video/console/font_7x14.c
index 1fa7fcf2ff72..bbf116647397 100644
--- a/drivers/video/console/font_7x14.c
+++ b/drivers/video/console/font_7x14.c
@@ -7,7 +7,7 @@
7 7
8#define FONTDATAMAX 3584 8#define FONTDATAMAX 3584
9 9
10static unsigned char fontdata_7x14[FONTDATAMAX] = { 10static const unsigned char fontdata_7x14[FONTDATAMAX] = {
11 11
12 /* 0 0x00 '^@' */ 12 /* 0 0x00 '^@' */
13 0x00, /* 0000000 */ 13 0x00, /* 0000000 */
@@ -4108,7 +4108,7 @@ static unsigned char fontdata_7x14[FONTDATAMAX] = {
4108}; 4108};
4109 4109
4110 4110
4111struct font_desc font_7x14 = { 4111const struct font_desc font_7x14 = {
4112 FONT7x14_IDX, 4112 FONT7x14_IDX,
4113 "7x14", 4113 "7x14",
4114 7, 4114 7,
diff --git a/drivers/video/console/font_8x16.c b/drivers/video/console/font_8x16.c
index e6f8dbaa122b..74fe86f28ff4 100644
--- a/drivers/video/console/font_8x16.c
+++ b/drivers/video/console/font_8x16.c
@@ -8,7 +8,7 @@
8 8
9#define FONTDATAMAX 4096 9#define FONTDATAMAX 4096
10 10
11static unsigned char fontdata_8x16[FONTDATAMAX] = { 11static const unsigned char fontdata_8x16[FONTDATAMAX] = {
12 12
13 /* 0 0x00 '^@' */ 13 /* 0 0x00 '^@' */
14 0x00, /* 00000000 */ 14 0x00, /* 00000000 */
@@ -4621,7 +4621,7 @@ static unsigned char fontdata_8x16[FONTDATAMAX] = {
4621}; 4621};
4622 4622
4623 4623
4624struct font_desc font_vga_8x16 = { 4624const struct font_desc font_vga_8x16 = {
4625 VGA8x16_IDX, 4625 VGA8x16_IDX,
4626 "VGA8x16", 4626 "VGA8x16",
4627 8, 4627 8,
diff --git a/drivers/video/console/font_8x8.c b/drivers/video/console/font_8x8.c
index 57fbe266a6b9..26199f8ee908 100644
--- a/drivers/video/console/font_8x8.c
+++ b/drivers/video/console/font_8x8.c
@@ -8,7 +8,7 @@
8 8
9#define FONTDATAMAX 2048 9#define FONTDATAMAX 2048
10 10
11static unsigned char fontdata_8x8[FONTDATAMAX] = { 11static const unsigned char fontdata_8x8[FONTDATAMAX] = {
12 12
13 /* 0 0x00 '^@' */ 13 /* 0 0x00 '^@' */
14 0x00, /* 00000000 */ 14 0x00, /* 00000000 */
@@ -2573,7 +2573,7 @@ static unsigned char fontdata_8x8[FONTDATAMAX] = {
2573}; 2573};
2574 2574
2575 2575
2576struct font_desc font_vga_8x8 = { 2576const struct font_desc font_vga_8x8 = {
2577 VGA8x8_IDX, 2577 VGA8x8_IDX,
2578 "VGA8x8", 2578 "VGA8x8",
2579 8, 2579 8,
diff --git a/drivers/video/console/font_acorn_8x8.c b/drivers/video/console/font_acorn_8x8.c
index d565505e3069..2d2e39632e2d 100644
--- a/drivers/video/console/font_acorn_8x8.c
+++ b/drivers/video/console/font_acorn_8x8.c
@@ -3,7 +3,7 @@
3#include <linux/config.h> 3#include <linux/config.h>
4#include <linux/font.h> 4#include <linux/font.h>
5 5
6static unsigned char acorndata_8x8[] = { 6static const unsigned char acorndata_8x8[] = {
7/* 00 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ^@ */ 7/* 00 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ^@ */
8/* 01 */ 0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e, /* ^A */ 8/* 01 */ 0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e, /* ^A */
9/* 02 */ 0x7e, 0xff, 0xbd, 0xff, 0xc3, 0xe7, 0xff, 0x7e, /* ^B */ 9/* 02 */ 0x7e, 0xff, 0xbd, 0xff, 0xc3, 0xe7, 0xff, 0x7e, /* ^B */
@@ -262,7 +262,7 @@ static unsigned char acorndata_8x8[] = {
262/* FF */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 262/* FF */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
263}; 263};
264 264
265struct font_desc font_acorn_8x8 = { 265const struct font_desc font_acorn_8x8 = {
266 ACORN8x8_IDX, 266 ACORN8x8_IDX,
267 "Acorn8x8", 267 "Acorn8x8",
268 8, 268 8,
diff --git a/drivers/video/console/font_mini_4x6.c b/drivers/video/console/font_mini_4x6.c
index 593b95500a0c..d818234fdf11 100644
--- a/drivers/video/console/font_mini_4x6.c
+++ b/drivers/video/console/font_mini_4x6.c
@@ -43,7 +43,7 @@ __END__;
43 43
44#define FONTDATAMAX 1536 44#define FONTDATAMAX 1536
45 45
46static unsigned char fontdata_mini_4x6[FONTDATAMAX] = { 46static const unsigned char fontdata_mini_4x6[FONTDATAMAX] = {
47 47
48 /*{*/ 48 /*{*/
49 /* Char 0: ' ' */ 49 /* Char 0: ' ' */
@@ -2147,7 +2147,7 @@ static unsigned char fontdata_mini_4x6[FONTDATAMAX] = {
2147 /*}*/ 2147 /*}*/
2148}; 2148};
2149 2149
2150struct font_desc font_mini_4x6 = { 2150const struct font_desc font_mini_4x6 = {
2151 MINI4x6_IDX, 2151 MINI4x6_IDX,
2152 "MINI4x6", 2152 "MINI4x6",
2153 4, 2153 4,
diff --git a/drivers/video/console/font_pearl_8x8.c b/drivers/video/console/font_pearl_8x8.c
index 5fa95f118818..e646c88f55c7 100644
--- a/drivers/video/console/font_pearl_8x8.c
+++ b/drivers/video/console/font_pearl_8x8.c
@@ -13,7 +13,7 @@
13 13
14#define FONTDATAMAX 2048 14#define FONTDATAMAX 2048
15 15
16static unsigned char fontdata_pearl8x8[FONTDATAMAX] = { 16static const unsigned char fontdata_pearl8x8[FONTDATAMAX] = {
17 17
18 /* 0 0x00 '^@' */ 18 /* 0 0x00 '^@' */
19 0x00, /* 00000000 */ 19 0x00, /* 00000000 */
@@ -2577,7 +2577,7 @@ static unsigned char fontdata_pearl8x8[FONTDATAMAX] = {
2577 2577
2578}; 2578};
2579 2579
2580struct font_desc font_pearl_8x8 = { 2580const struct font_desc font_pearl_8x8 = {
2581 PEARL8x8_IDX, 2581 PEARL8x8_IDX,
2582 "PEARL8x8", 2582 "PEARL8x8",
2583 8, 2583 8,
diff --git a/drivers/video/console/font_sun12x22.c b/drivers/video/console/font_sun12x22.c
index c7bd967ea100..ab5eb93407b4 100644
--- a/drivers/video/console/font_sun12x22.c
+++ b/drivers/video/console/font_sun12x22.c
@@ -2,7 +2,7 @@
2 2
3#define FONTDATAMAX 11264 3#define FONTDATAMAX 11264
4 4
5static unsigned char fontdata_sun12x22[FONTDATAMAX] = { 5static const unsigned char fontdata_sun12x22[FONTDATAMAX] = {
6 6
7 /* 0 0x00 '^@' */ 7 /* 0 0x00 '^@' */
8 0x00, 0x00, /* 000000000000 */ 8 0x00, 0x00, /* 000000000000 */
@@ -6151,7 +6151,7 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
6151}; 6151};
6152 6152
6153 6153
6154struct font_desc font_sun_12x22 = { 6154const struct font_desc font_sun_12x22 = {
6155 SUN12x22_IDX, 6155 SUN12x22_IDX,
6156 "SUN12x22", 6156 "SUN12x22",
6157 12, 6157 12,
diff --git a/drivers/video/console/font_sun8x16.c b/drivers/video/console/font_sun8x16.c
index 2af3ab354652..41f910f5529c 100644
--- a/drivers/video/console/font_sun8x16.c
+++ b/drivers/video/console/font_sun8x16.c
@@ -2,7 +2,7 @@
2 2
3#define FONTDATAMAX 4096 3#define FONTDATAMAX 4096
4 4
5static unsigned char fontdata_sun8x16[FONTDATAMAX] = { 5static const unsigned char fontdata_sun8x16[FONTDATAMAX] = {
6/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
7/* */ 0x00,0x00,0x7e,0x81,0xa5,0x81,0x81,0xbd,0x99,0x81,0x81,0x7e,0x00,0x00,0x00,0x00, 7/* */ 0x00,0x00,0x7e,0x81,0xa5,0x81,0x81,0xbd,0x99,0x81,0x81,0x7e,0x00,0x00,0x00,0x00,
8/* */ 0x00,0x00,0x7e,0xff,0xdb,0xff,0xff,0xc3,0xe7,0xff,0xff,0x7e,0x00,0x00,0x00,0x00, 8/* */ 0x00,0x00,0x7e,0xff,0xdb,0xff,0xff,0xc3,0xe7,0xff,0xff,0x7e,0x00,0x00,0x00,0x00,
@@ -261,7 +261,7 @@ static unsigned char fontdata_sun8x16[FONTDATAMAX] = {
261/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 261/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
262}; 262};
263 263
264struct font_desc font_sun_8x16 = { 264const struct font_desc font_sun_8x16 = {
265 SUN8x16_IDX, 265 SUN8x16_IDX,
266 "SUN8x16", 266 "SUN8x16",
267 8, 267 8,
diff --git a/drivers/video/console/fonts.c b/drivers/video/console/fonts.c
index e79b29702649..4fd07d9eca03 100644
--- a/drivers/video/console/fonts.c
+++ b/drivers/video/console/fonts.c
@@ -23,7 +23,7 @@
23 23
24#define NO_FONTS 24#define NO_FONTS
25 25
26static struct font_desc *fonts[] = { 26static const struct font_desc *fonts[] = {
27#ifdef CONFIG_FONT_8x8 27#ifdef CONFIG_FONT_8x8
28#undef NO_FONTS 28#undef NO_FONTS
29 &font_vga_8x8, 29 &font_vga_8x8,
@@ -84,7 +84,7 @@ static struct font_desc *fonts[] = {
84 * 84 *
85 */ 85 */
86 86
87struct font_desc *find_font(char *name) 87const struct font_desc *find_font(const char *name)
88{ 88{
89 unsigned int i; 89 unsigned int i;
90 90
@@ -108,10 +108,10 @@ struct font_desc *find_font(char *name)
108 * 108 *
109 */ 109 */
110 110
111struct font_desc *get_default_font(int xres, int yres) 111const struct font_desc *get_default_font(int xres, int yres)
112{ 112{
113 int i, c, cc; 113 int i, c, cc;
114 struct font_desc *f, *g; 114 const struct font_desc *f, *g;
115 115
116 g = NULL; 116 g = NULL;
117 cc = -10000; 117 cc = -10000;
@@ -138,7 +138,6 @@ struct font_desc *get_default_font(int xres, int yres)
138 return g; 138 return g;
139} 139}
140 140
141EXPORT_SYMBOL(fonts);
142EXPORT_SYMBOL(find_font); 141EXPORT_SYMBOL(find_font);
143EXPORT_SYMBOL(get_default_font); 142EXPORT_SYMBOL(get_default_font);
144 143