aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/vt_buffer.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/vt_buffer.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/linux/vt_buffer.h')
-rw-r--r--include/linux/vt_buffer.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/include/linux/vt_buffer.h b/include/linux/vt_buffer.h
new file mode 100644
index 000000000000..1f7ba3629053
--- /dev/null
+++ b/include/linux/vt_buffer.h
@@ -0,0 +1,64 @@
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#include <linux/config.h>
17
18#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE)
19#include <asm/vga.h>
20#endif
21
22#ifndef VT_BUF_HAVE_RW
23#define scr_writew(val, addr) (*(addr) = (val))
24#define scr_readw(addr) (*(addr))
25#define scr_memcpyw(d, s, c) memcpy(d, s, c)
26#define scr_memmovew(d, s, c) memmove(d, s, c)
27#define VT_BUF_HAVE_MEMCPYW
28#define VT_BUF_HAVE_MEMMOVEW
29#endif
30
31#ifndef VT_BUF_HAVE_MEMSETW
32static inline void scr_memsetw(u16 *s, u16 c, unsigned int count)
33{
34 count /= 2;
35 while (count--)
36 scr_writew(c, s++);
37}
38#endif
39
40#ifndef VT_BUF_HAVE_MEMCPYW
41static inline void scr_memcpyw(u16 *d, const u16 *s, unsigned int count)
42{
43 count /= 2;
44 while (count--)
45 scr_writew(scr_readw(s++), d++);
46}
47#endif
48
49#ifndef VT_BUF_HAVE_MEMMOVEW
50static inline void scr_memmovew(u16 *d, const u16 *s, unsigned int count)
51{
52 if (d < s)
53 scr_memcpyw(d, s, count);
54 else {
55 count /= 2;
56 d += count;
57 s += count;
58 while (count--)
59 scr_writew(scr_readw(--s), --d);
60 }
61}
62#endif
63
64#endif