| linuxppc@jdl.com | 8b22cc0 | 2005-09-20 14:32:37 -0500 | [diff] [blame] | 1 | #ifndef _ASM_POWERPC_VGA_H_ | 
 | 2 | #define _ASM_POWERPC_VGA_H_ | 
 | 3 |  | 
 | 4 | #ifdef __KERNEL__ | 
 | 5 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | /* | 
 | 7 |  *	Access to VGA videoram | 
 | 8 |  * | 
 | 9 |  *	(c) 1998 Martin Mares <mj@ucw.cz> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 |  */ | 
 | 11 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 |  | 
 | 13 | #include <asm/io.h> | 
 | 14 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 |  | 
 | 16 | #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE) | 
 | 17 |  | 
 | 18 | #define VT_BUF_HAVE_RW | 
 | 19 | /* | 
 | 20 |  *  These are only needed for supporting VGA or MDA text mode, which use little | 
 | 21 |  *  endian byte ordering. | 
 | 22 |  *  In other cases, we can optimize by using native byte ordering and | 
 | 23 |  *  <linux/vt_buffer.h> has already done the right job for us. | 
 | 24 |  */ | 
 | 25 |  | 
 | 26 | static inline void scr_writew(u16 val, volatile u16 *addr) | 
 | 27 | { | 
 | 28 |     st_le16(addr, val); | 
 | 29 | } | 
 | 30 |  | 
 | 31 | static inline u16 scr_readw(volatile const u16 *addr) | 
 | 32 | { | 
 | 33 |     return ld_le16(addr); | 
 | 34 | } | 
 | 35 |  | 
 | 36 | #define VT_BUF_HAVE_MEMCPYW | 
 | 37 | #define scr_memcpyw	memcpy | 
 | 38 |  | 
 | 39 | #endif /* !CONFIG_VGA_CONSOLE && !CONFIG_MDA_CONSOLE */ | 
 | 40 |  | 
 | 41 | extern unsigned long vgacon_remap_base; | 
| linuxppc@jdl.com | 8b22cc0 | 2005-09-20 14:32:37 -0500 | [diff] [blame] | 42 |  | 
 | 43 | #ifdef __powerpc64__ | 
| Bjorn Helgaas | 4f1bcaf | 2006-06-22 14:47:32 -0700 | [diff] [blame] | 44 | #define VGA_MAP_MEM(x,s) ((unsigned long) ioremap((x), s)) | 
| linuxppc@jdl.com | 8b22cc0 | 2005-09-20 14:32:37 -0500 | [diff] [blame] | 45 | #else | 
| Bjorn Helgaas | 4f1bcaf | 2006-06-22 14:47:32 -0700 | [diff] [blame] | 46 | #define VGA_MAP_MEM(x,s) (x + vgacon_remap_base) | 
| linuxppc@jdl.com | 8b22cc0 | 2005-09-20 14:32:37 -0500 | [diff] [blame] | 47 | #endif | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 |  | 
 | 49 | #define vga_readb(x) (*(x)) | 
 | 50 | #define vga_writeb(x,y) (*(y) = (x)) | 
 | 51 |  | 
| linuxppc@jdl.com | 8b22cc0 | 2005-09-20 14:32:37 -0500 | [diff] [blame] | 52 | #endif	/* __KERNEL__ */ | 
 | 53 | #endif	/* _ASM_POWERPC_VGA_H_ */ |