vga.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE)
  11. #define VT_BUF_HAVE_RW
  12. /*
  13. * These are only needed for supporting VGA or MDA text mode, which use little
  14. * endian byte ordering.
  15. * In other cases, we can optimize by using native byte ordering and
  16. * <linux/vt_buffer.h> has already done the right job for us.
  17. */
  18. static inline void scr_writew(u16 val, volatile u16 *addr)
  19. {
  20. *addr = cpu_to_le16(val);
  21. }
  22. static inline u16 scr_readw(volatile const u16 *addr)
  23. {
  24. return le16_to_cpu(*addr);
  25. }
  26. #define VT_BUF_HAVE_MEMCPYW
  27. #define scr_memcpyw memcpy
  28. #endif /* !CONFIG_VGA_CONSOLE && !CONFIG_MDA_CONSOLE */
  29. #ifdef __powerpc64__
  30. #define VGA_MAP_MEM(x,s) ((unsigned long) ioremap((x), s))
  31. #else
  32. #define VGA_MAP_MEM(x,s) (x)
  33. #endif
  34. #define vga_readb(x) (*(x))
  35. #define vga_writeb(x,y) (*(y) = (x))
  36. #endif /* __KERNEL__ */
  37. #endif /* _ASM_POWERPC_VGA_H_ */