vga.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef _ASM_POWERPC_VGA_H_
  2. #define _ASM_POWERPC_VGA_H_
  3. #ifdef __KERNEL__
  4. /*
  5. * Access to VGA videoram
  6. *
  7. * (c) 1998 Martin Mares <mj@ucw.cz>
  8. */
  9. #include <asm/io.h>
  10. #include <linux/config.h>
  11. #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE)
  12. #define VT_BUF_HAVE_RW
  13. /*
  14. * These are only needed for supporting VGA or MDA text mode, which use little
  15. * endian byte ordering.
  16. * In other cases, we can optimize by using native byte ordering and
  17. * <linux/vt_buffer.h> has already done the right job for us.
  18. */
  19. static inline void scr_writew(u16 val, volatile u16 *addr)
  20. {
  21. st_le16(addr, val);
  22. }
  23. static inline u16 scr_readw(volatile const u16 *addr)
  24. {
  25. return ld_le16(addr);
  26. }
  27. #define VT_BUF_HAVE_MEMCPYW
  28. #define scr_memcpyw memcpy
  29. #endif /* !CONFIG_VGA_CONSOLE && !CONFIG_MDA_CONSOLE */
  30. extern unsigned long vgacon_remap_base;
  31. #ifdef __powerpc64__
  32. #define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0))
  33. #else
  34. #define VGA_MAP_MEM(x) (x + vgacon_remap_base)
  35. #endif
  36. #define vga_readb(x) (*(x))
  37. #define vga_writeb(x,y) (*(y) = (x))
  38. #endif /* __KERNEL__ */
  39. #endif /* _ASM_POWERPC_VGA_H_ */