Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lib/fonts: Remove internal symbols and macros from public header file

Define access macros for font_data_t in fonts.c. Define struct font_data
and declare most of the font symbols in the internal header font.h, where
they can only be seen by the font code.

Also move font indices into internal font.h. They appear to be unused
though. There is m86k assembly code that operates on the idx field, so
leave them in place for now.

List all built-in fonts in a separate section in the public header file.

v2:
- do not add config guards around font symbols (Helge)
- keep declaration of built-in fonts in public header

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Thomas Zimmermann and committed by
Helge Deller
db65872b c37bd7c8

+85 -55
+17 -40
include/linux/font.h
··· 77 77 int pref; 78 78 }; 79 79 80 - #define VGA8x8_IDX 0 81 - #define VGA8x16_IDX 1 82 - #define PEARL8x8_IDX 2 83 - #define VGA6x11_IDX 3 84 - #define FONT7x14_IDX 4 85 - #define FONT10x18_IDX 5 86 - #define SUN8x16_IDX 6 87 - #define SUN12x22_IDX 7 88 - #define ACORN8x8_IDX 8 89 - #define MINI4x6_IDX 9 90 - #define FONT6x10_IDX 10 91 - #define TER16x32_IDX 11 92 - #define FONT6x8_IDX 12 93 - #define TER10x18_IDX 13 94 - 95 - extern const struct font_desc font_vga_8x8, 96 - font_vga_8x16, 97 - font_pearl_8x8, 98 - font_vga_6x11, 99 - font_7x14, 100 - font_10x18, 101 - font_sun_8x16, 102 - font_sun_12x22, 103 - font_acorn_8x8, 104 - font_mini_4x6, 105 - font_6x10, 106 - font_ter_16x32, 107 - font_6x8, 108 - font_ter_10x18; 109 - 110 80 /* Find a font with a specific name */ 111 81 112 82 extern const struct font_desc *find_font(const char *name); ··· 90 120 /* Max. length for the name of a predefined font */ 91 121 #define MAX_FONT_NAME 32 92 122 93 - /* Extra word getters */ 94 - #define REFCOUNT(fd) (((int *)(fd))[-1]) 95 - #define FNTSIZE(fd) (((int *)(fd))[-2]) 96 - #define FNTSUM(fd) (((int *)(fd))[-4]) 123 + /* 124 + * Built-in fonts 125 + */ 97 126 98 - #define FONT_EXTRA_WORDS 4 99 - 100 - struct font_data { 101 - unsigned int extra[FONT_EXTRA_WORDS]; 102 - unsigned char data[]; 103 - } __packed; 127 + extern const struct font_desc font_10x18; 128 + extern const struct font_desc font_6x10; 129 + extern const struct font_desc font_6x8; 130 + extern const struct font_desc font_7x14; 131 + extern const struct font_desc font_acorn_8x8; 132 + extern const struct font_desc font_mini_4x6; 133 + extern const struct font_desc font_pearl_8x8; 134 + extern const struct font_desc font_sun_12x22; 135 + extern const struct font_desc font_sun_8x16; 136 + extern const struct font_desc font_ter_10x18; 137 + extern const struct font_desc font_ter_16x32; 138 + extern const struct font_desc font_vga_6x11; 139 + extern const struct font_desc font_vga_8x16; 140 + extern const struct font_desc font_vga_8x8; 104 141 105 142 #endif /* _VIDEO_FONT_H */
+38
lib/fonts/font.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + 3 + #ifndef _LIB_FONTS_FONT_H 4 + #define _LIB_FONTS_FONT_H 5 + 6 + #include <linux/font.h> 7 + 8 + /* 9 + * Font data 10 + */ 11 + 12 + #define FONT_EXTRA_WORDS 4 13 + 14 + struct font_data { 15 + unsigned int extra[FONT_EXTRA_WORDS]; 16 + unsigned char data[]; 17 + } __packed; 18 + 19 + /* 20 + * Built-in fonts 21 + */ 22 + 23 + #define VGA8x8_IDX 0 24 + #define VGA8x16_IDX 1 25 + #define PEARL8x8_IDX 2 26 + #define VGA6x11_IDX 3 27 + #define FONT7x14_IDX 4 28 + #define FONT10x18_IDX 5 29 + #define SUN8x16_IDX 6 30 + #define SUN12x22_IDX 7 31 + #define ACORN8x8_IDX 8 32 + #define MINI4x6_IDX 9 33 + #define FONT6x10_IDX 10 34 + #define TER16x32_IDX 11 35 + #define FONT6x8_IDX 12 36 + #define TER10x18_IDX 13 37 + 38 + #endif
+1 -1
lib/fonts/font_10x18.c
··· 4 4 * by Jurriaan Kalkman 06-2005 * 5 5 ********************************/ 6 6 7 - #include <linux/font.h> 7 + #include "font.h" 8 8 9 9 #define FONTDATAMAX 9216 10 10
+2 -1
lib/fonts/font_6x10.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 - #include <linux/font.h> 2 + 3 + #include "font.h" 3 4 4 5 #define FONTDATAMAX 2560 5 6
+1 -1
lib/fonts/font_6x11.c
··· 5 5 /* */ 6 6 /**********************************************/ 7 7 8 - #include <linux/font.h> 8 + #include "font.h" 9 9 10 10 #define FONTDATAMAX (11*256) 11 11
+2 -1
lib/fonts/font_6x8.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 - #include <linux/font.h> 2 + 3 + #include "font.h" 3 4 4 5 #define FONTDATAMAX 2048 5 6
+1 -1
lib/fonts/font_7x14.c
··· 4 4 /* by Jurriaan Kalkman 05-2005 */ 5 5 /**************************************/ 6 6 7 - #include <linux/font.h> 7 + #include "font.h" 8 8 9 9 #define FONTDATAMAX 3584 10 10
+2 -1
lib/fonts/font_8x16.c
··· 5 5 /* */ 6 6 /**********************************************/ 7 7 8 - #include <linux/font.h> 9 8 #include <linux/module.h> 9 + 10 + #include "font.h" 10 11 11 12 #define FONTDATAMAX 4096 12 13
+1 -1
lib/fonts/font_8x8.c
··· 5 5 /* */ 6 6 /**********************************************/ 7 7 8 - #include <linux/font.h> 8 + #include "font.h" 9 9 10 10 #define FONTDATAMAX 2048 11 11
+1 -1
lib/fonts/font_acorn_8x8.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* Acorn-like font definition, with PC graphics characters */ 3 3 4 - #include <linux/font.h> 4 + #include "font.h" 5 5 6 6 #define FONTDATAMAX 2048 7 7
+1 -1
lib/fonts/font_mini_4x6.c
··· 39 39 MSBit to LSBit = left to right. 40 40 */ 41 41 42 - #include <linux/font.h> 42 + #include "font.h" 43 43 44 44 #define FONTDATAMAX 1536 45 45
+1 -1
lib/fonts/font_pearl_8x8.c
··· 10 10 /* */ 11 11 /**********************************************/ 12 12 13 - #include <linux/font.h> 13 + #include "font.h" 14 14 15 15 #define FONTDATAMAX 2048 16 16
+2 -1
lib/fonts/font_sun12x22.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 - #include <linux/font.h> 2 + 3 + #include "font.h" 3 4 4 5 #define FONTDATAMAX 11264 5 6
+2 -1
lib/fonts/font_sun8x16.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 - #include <linux/font.h> 2 + 3 + #include "font.h" 3 4 4 5 #define FONTDATAMAX 4096 5 6
+3 -1
lib/fonts/font_ter10x18.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 - #include <linux/font.h> 2 + 3 3 #include <linux/module.h> 4 + 5 + #include "font.h" 4 6 5 7 #define FONTDATAMAX 9216 6 8
+3 -1
lib/fonts/font_ter16x32.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 - #include <linux/font.h> 2 + 3 3 #include <linux/module.h> 4 + 5 + #include "font.h" 4 6 5 7 #define FONTDATAMAX 16384 6 8
+7 -1
lib/fonts/fonts.c
··· 13 13 */ 14 14 15 15 #include <linux/container_of.h> 16 - #include <linux/font.h> 17 16 #include <linux/kd.h> 18 17 #include <linux/module.h> 19 18 #include <linux/overflow.h> ··· 24 25 #include <asm/setup.h> 25 26 #endif 26 27 28 + #include "font.h" 29 + 27 30 #define console_font_pitch(font) DIV_ROUND_UP((font)->width, 8) 28 31 29 32 /* 30 33 * Helpers for font_data_t 31 34 */ 35 + 36 + /* Extra word getters */ 37 + #define REFCOUNT(fd) (((int *)(fd))[-1]) 38 + #define FNTSIZE(fd) (((int *)(fd))[-2]) 39 + #define FNTSUM(fd) (((int *)(fd))[-4]) 32 40 33 41 static struct font_data *to_font_data_struct(font_data_t *fd) 34 42 {