0001
0002 #ifndef _ASM_POWERPC_VGA_H_
0003 #define _ASM_POWERPC_VGA_H_
0004
0005 #ifdef __KERNEL__
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include <asm/io.h>
0015
0016
0017 #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE)
0018
0019 #define VT_BUF_HAVE_RW
0020
0021
0022
0023
0024
0025
0026
0027 static inline void scr_writew(u16 val, volatile u16 *addr)
0028 {
0029 *addr = cpu_to_le16(val);
0030 }
0031
0032 static inline u16 scr_readw(volatile const u16 *addr)
0033 {
0034 return le16_to_cpu(*addr);
0035 }
0036
0037 #define VT_BUF_HAVE_MEMSETW
0038 static inline void scr_memsetw(u16 *s, u16 v, unsigned int n)
0039 {
0040 memset16(s, cpu_to_le16(v), n / 2);
0041 }
0042
0043 #define VT_BUF_HAVE_MEMCPYW
0044 #define VT_BUF_HAVE_MEMMOVEW
0045 #define scr_memcpyw memcpy
0046 #define scr_memmovew memmove
0047
0048 #endif
0049
0050 #ifdef __powerpc64__
0051 #define VGA_MAP_MEM(x,s) ((unsigned long) ioremap((x), s))
0052 #else
0053 #define VGA_MAP_MEM(x,s) (x)
0054 #endif
0055
0056 #define vga_readb(x) (*(x))
0057 #define vga_writeb(x,y) (*(y) = (x))
0058
0059 #endif
0060 #endif