1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef _LINUX_VT_BUFFER_H_
14#define _LINUX_VT_BUFFER_H_
15
16
17#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE)
18#include <asm/vga.h>
19#endif
20
21#ifndef VT_BUF_HAVE_RW
22#define scr_writew(val, addr) (*(addr) = (val))
23#define scr_readw(addr) (*(addr))
24#endif
25
26#ifndef VT_BUF_HAVE_MEMSETW
27static inline void scr_memsetw(u16 *s, u16 c, unsigned int count)
28{
29 count /= 2;
30 while (count--)
31 scr_writew(c, s++);
32}
33#endif
34
35#ifndef VT_BUF_HAVE_MEMCPYW
36static inline void scr_memcpyw(u16 *d, const u16 *s, unsigned int count)
37{
38 count /= 2;
39 while (count--)
40 scr_writew(scr_readw(s++), d++);
41}
42#endif
43
44#ifndef VT_BUF_HAVE_MEMMOVEW
45static inline void scr_memmovew(u16 *d, const u16 *s, unsigned int count)
46{
47 if (d < s)
48 scr_memcpyw(d, s, count);
49 else {
50 count /= 2;
51 d += count;
52 s += count;
53 while (count--)
54 scr_writew(scr_readw(--s), --d);
55 }
56}
57#endif
58
59#endif
60