vga.h 1.0 KB

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