vga.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Access to VGA videoram
  3. *
  4. * (c) 1998 Martin Mares <mj@ucw.cz>
  5. */
  6. #ifndef _ASM_VGA_H
  7. #define _ASM_VGA_H
  8. #include <asm/addrspace.h>
  9. #include <asm/byteorder.h>
  10. /*
  11. * On the PC, we can just recalculate addresses and then
  12. * access the videoram directly without any black magic.
  13. */
  14. #define VGA_MAP_MEM(x, s) CKSEG1ADDR(0x10000000L + (unsigned long)(x))
  15. #define vga_readb(x) (*(x))
  16. #define vga_writeb(x, y) (*(y) = (x))
  17. #define VT_BUF_HAVE_RW
  18. /*
  19. * These are only needed for supporting VGA or MDA text mode, which use little
  20. * endian byte ordering.
  21. * In other cases, we can optimize by using native byte ordering and
  22. * <linux/vt_buffer.h> has already done the right job for us.
  23. */
  24. #undef scr_writew
  25. #undef scr_readw
  26. static inline void scr_writew(u16 val, volatile u16 *addr)
  27. {
  28. *addr = cpu_to_le16(val);
  29. }
  30. static inline u16 scr_readw(volatile const u16 *addr)
  31. {
  32. return le16_to_cpu(*addr);
  33. }
  34. #define scr_memcpyw(d, s, c) memcpy(d, s, c)
  35. #define scr_memmovew(d, s, c) memmove(d, s, c)
  36. #define VT_BUF_HAVE_MEMCPYW
  37. #define VT_BUF_HAVE_MEMMOVEW
  38. #endif /* _ASM_VGA_H */