Root/
1 | /* |
2 | * include/linux/vt_buffer.h -- Access to VT screen buffer |
3 | * |
4 | * (c) 1998 Martin Mares <mj@ucw.cz> |
5 | * |
6 | * This is a set of macros and functions which are used in the |
7 | * console driver and related code to access the screen buffer. |
8 | * In most cases the console works with simple in-memory buffer, |
9 | * but when handling hardware text mode consoles, we store |
10 | * the foreground console directly in video memory. |
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 | #define scr_memcpyw(d, s, c) memcpy(d, s, c) |
25 | #define scr_memmovew(d, s, c) memmove(d, s, c) |
26 | #define VT_BUF_HAVE_MEMCPYW |
27 | #define VT_BUF_HAVE_MEMMOVEW |
28 | #endif |
29 | |
30 | #ifndef VT_BUF_HAVE_MEMSETW |
31 | static inline void scr_memsetw(u16 *s, u16 c, unsigned int count) |
32 | { |
33 | count /= 2; |
34 | while (count--) |
35 | scr_writew(c, s++); |
36 | } |
37 | #endif |
38 | |
39 | #ifndef VT_BUF_HAVE_MEMCPYW |
40 | static inline void scr_memcpyw(u16 *d, const u16 *s, unsigned int count) |
41 | { |
42 | count /= 2; |
43 | while (count--) |
44 | scr_writew(scr_readw(s++), d++); |
45 | } |
46 | #endif |
47 | |
48 | #ifndef VT_BUF_HAVE_MEMMOVEW |
49 | static inline void scr_memmovew(u16 *d, const u16 *s, unsigned int count) |
50 | { |
51 | if (d < s) |
52 | scr_memcpyw(d, s, count); |
53 | else { |
54 | count /= 2; |
55 | d += count; |
56 | s += count; |
57 | while (count--) |
58 | scr_writew(scr_readw(--s), --d); |
59 | } |
60 | } |
61 | #endif |
62 | |
63 | #endif |
64 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9