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. #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. st_le16(addr, val);
  21. }
  22. static inline u16 scr_readw(volatile const u16 *addr)
  23. {
  24. return ld_le16(addr);
  25. }
  26. #define VT_BUF_HAVE_MEMCPYW
  27. #define scr_memcpyw memcpy
  28. #endif /* !CONFIG_VGA_CONSOLE && !CONFIG_MDA_CONSOLE */
  29. extern unsigned long vgacon_remap_base;
  30. #ifdef __powerpc64__
  31. #define VGA_MAP_MEM(x,s) ((unsigned long) ioremap((x), s))
  32. #else
  33. #define VGA_MAP_MEM(x,s) (x + vgacon_remap_base)
  34. #endif
  35. #define vga_readb(x) (*(x))
  36. #define vga_writeb(x,y) (*(y) = (x))
  37. #endif /* __KERNEL__ */
  38. #endif /* _ASM_POWERPC_VGA_H_ */