vga.h 997 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Access to VGA videoram
  3. *
  4. * (c) 1998 Martin Mares <mj@ucw.cz>
  5. */
  6. #ifdef __KERNEL__
  7. #ifndef _LINUX_ASM_VGA_H_
  8. #define _LINUX_ASM_VGA_H_
  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. extern inline void scr_writew(u16 val, volatile u16 *addr)
  20. {
  21. st_le16(addr, val);
  22. }
  23. extern 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. #define VGA_MAP_MEM(x) (x + vgacon_remap_base)
  32. #define vga_readb(x) (*(x))
  33. #define vga_writeb(x,y) (*(y) = (x))
  34. #endif
  35. #endif /* __KERNEL__ */