Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / powerpc / include / asm / vga.h
blobfcf721682a7119f0fa8f90560939a78d7da559c2
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_VGA_H_
3 #define _ASM_POWERPC_VGA_H_
5 #ifdef __KERNEL__
7 /*
8 * Access to VGA videoram
10 * (c) 1998 Martin Mares <mj@ucw.cz>
14 #include <asm/io.h>
17 #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE)
19 #define VT_BUF_HAVE_RW
21 * These are only needed for supporting VGA or MDA text mode, which use little
22 * endian byte ordering.
23 * In other cases, we can optimize by using native byte ordering and
24 * <linux/vt_buffer.h> has already done the right job for us.
27 static inline void scr_writew(u16 val, volatile u16 *addr)
29 *addr = cpu_to_le16(val);
32 static inline u16 scr_readw(volatile const u16 *addr)
34 return le16_to_cpu(*addr);
37 #define VT_BUF_HAVE_MEMSETW
38 static inline void scr_memsetw(u16 *s, u16 v, unsigned int n)
40 memset16(s, cpu_to_le16(v), n / 2);
43 #define VT_BUF_HAVE_MEMCPYW
44 #define VT_BUF_HAVE_MEMMOVEW
45 #define scr_memcpyw memcpy
46 #define scr_memmovew memmove
48 #endif /* !CONFIG_VGA_CONSOLE && !CONFIG_MDA_CONSOLE */
50 #ifdef __powerpc64__
51 #define VGA_MAP_MEM(x,s) ((unsigned long) ioremap((x), s))
52 #else
53 #define VGA_MAP_MEM(x,s) (x)
54 #endif
56 #define vga_readb(x) (*(x))
57 #define vga_writeb(x,y) (*(y) = (x))
59 #endif /* __KERNEL__ */
60 #endif /* _ASM_POWERPC_VGA_H_ */