xref: /openbmc/linux/arch/sparc/include/asm/vga.h (revision b78412b8)
1 /*
2  *	Access to VGA videoram
3  *
4  *	(c) 1998 Martin Mares <mj@ucw.cz>
5  */
6 
7 #ifndef _LINUX_ASM_VGA_H_
8 #define _LINUX_ASM_VGA_H_
9 
10 #include <linux/bug.h>
11 #include <linux/string.h>
12 #include <asm/types.h>
13 
14 #define VT_BUF_HAVE_RW
15 #define VT_BUF_HAVE_MEMSETW
16 #define VT_BUF_HAVE_MEMCPYW
17 #define VT_BUF_HAVE_MEMMOVEW
18 
19 #undef scr_writew
20 #undef scr_readw
21 
22 static inline void scr_writew(u16 val, u16 *addr)
23 {
24 	BUG_ON((long) addr >= 0);
25 
26 	*addr = val;
27 }
28 
29 static inline u16 scr_readw(const u16 *addr)
30 {
31 	BUG_ON((long) addr >= 0);
32 
33 	return *addr;
34 }
35 
36 static inline void scr_memsetw(u16 *p, u16 v, unsigned int n)
37 {
38 	BUG_ON((long) p >= 0);
39 
40 	memset16(p, cpu_to_le16(v), n / 2);
41 }
42 
43 static inline void scr_memcpyw(u16 *d, u16 *s, unsigned int n)
44 {
45 	BUG_ON((long) d >= 0);
46 
47 	memcpy(d, s, n);
48 }
49 
50 static inline void scr_memmovew(u16 *d, u16 *s, unsigned int n)
51 {
52 	BUG_ON((long) d >= 0);
53 
54 	memmove(d, s, n);
55 }
56 
57 #define VGA_MAP_MEM(x,s) (x)
58 
59 #endif
60