This source file includes following definitions.
- scr_writew
- scr_readw
- scr_writeb
- scr_readb
- scr_writew
- scr_readw
- scr_writeb
- scr_readb
- scr_writew
- scr_readw
- memsetw
- memcpyw
1
2
3
4
5
6 extern int sel_cons;
7
8 extern void clear_selection(void);
9 extern int set_selection(const unsigned long arg, struct tty_struct *tty);
10 extern int paste_selection(struct tty_struct *tty);
11 extern int sel_loadlut(const unsigned long arg);
12 extern int mouse_reporting(void);
13 extern void mouse_report(struct tty_struct * tty, int butt, int mrx, int mry);
14
15 extern unsigned long video_num_columns;
16 extern unsigned long video_num_lines;
17 extern unsigned long video_size_row;
18 extern unsigned char video_type;
19 extern unsigned long video_mem_base;
20 extern unsigned long video_mem_term;
21 extern unsigned long video_screen_size;
22 extern unsigned short video_port_reg;
23 extern unsigned short video_port_val;
24
25 extern int console_blanked;
26 extern int can_do_color;
27
28 extern unsigned long video_font_height;
29 extern unsigned long video_scan_lines;
30 extern unsigned long default_font_height;
31 extern int video_font_is_default;
32
33 extern unsigned char color_table[];
34 extern int default_red[];
35 extern int default_grn[];
36 extern int default_blu[];
37
38 extern unsigned short __real_origin;
39 extern unsigned short __origin;
40 extern unsigned short __scrollback_mode;
41
42 extern unsigned short *vc_scrbuf[MAX_NR_CONSOLES];
43
44 extern void do_unblank_screen(void);
45 extern unsigned short *screen_pos(int currcons, int w_offset, int viewed);
46 extern unsigned short screen_word(int currcons, int offset, int viewed);
47 extern int scrw2glyph(unsigned short scr_word);
48 extern void complement_pos(int currcons, int offset);
49 extern void invert_screen(int currcons, int offset, int count, int shift);
50
51 #define reverse_video_char(a) (((a) & 0x88) | ((((a) >> 4) | ((a) << 4)) & 0x77))
52 #define reverse_video_short(a) (((a) & 0x88ff) | \
53 (((a) & 0x7000) >> 4) | (((a) & 0x0700) << 4))
54
55
56
57 extern void getconsxy(int currcons, char *p);
58 extern void putconsxy(int currcons, char *p);
59
60
61
62
63 #include <linux/config.h>
64
65 #ifdef CONFIG_TGA_CONSOLE
66
67 extern int tga_blitc(unsigned int, unsigned long);
68 extern unsigned long video_mem_term;
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90 static inline void scr_writew(unsigned short val, unsigned short * addr)
91 {
92
93
94
95
96 *addr = val;
97 if ((unsigned long)addr < video_mem_term) {
98 tga_blitc(val, (unsigned long) addr);
99 }
100 }
101
102 static inline unsigned short scr_readw(unsigned short * addr)
103 {
104 return *addr;
105 }
106 #else
107
108
109
110
111
112
113 #ifdef __alpha__
114
115 #include <asm/io.h>
116
117
118
119
120
121
122 static inline void scr_writeb(unsigned char val, unsigned char * addr)
123 {
124 if ((long) addr < 0)
125 *addr = val;
126 else
127 writeb(val, (unsigned long) addr);
128 }
129
130 static inline unsigned char scr_readb(unsigned char * addr)
131 {
132 if ((long) addr < 0)
133 return *addr;
134 return readb((unsigned long) addr);
135 }
136
137 static inline void scr_writew(unsigned short val, unsigned short * addr)
138 {
139 if ((long) addr < 0)
140 *addr = val;
141 else
142 writew(val, (unsigned long) addr);
143 }
144
145 static inline unsigned short scr_readw(unsigned short * addr)
146 {
147 if ((long) addr < 0)
148 return *addr;
149 return readw((unsigned long) addr);
150 }
151
152 #else
153
154
155
156
157
158 static inline void scr_writeb(unsigned char val, unsigned char * addr)
159 {
160 *addr = val;
161 }
162
163 static inline unsigned char scr_readb(unsigned char * addr)
164 {
165 return *addr;
166 }
167
168 static inline void scr_writew(unsigned short val, unsigned short * addr)
169 {
170 *addr = val;
171 }
172
173 static inline unsigned short scr_readw(unsigned short * addr)
174 {
175 return *addr;
176 }
177
178 #endif
179 #endif
180
181 static inline void memsetw(void * s, unsigned short c, unsigned int count)
182 {
183 unsigned short * addr = (unsigned short *) s;
184
185 count /= 2;
186 while (count) {
187 count--;
188 scr_writew(c, addr++);
189 }
190 }
191
192 static inline void memcpyw(unsigned short *to, unsigned short *from,
193 unsigned int count)
194 {
195 count /= 2;
196 while (count) {
197 count--;
198 scr_writew(scr_readw(from++), to++);
199 }
200 }