vga.h 964 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Access to VGA videoram
  4. *
  5. * (c) 1998 Martin Mares <[email protected]>
  6. */
  7. #ifndef _LINUX_ASM_VGA_H_
  8. #define _LINUX_ASM_VGA_H_
  9. #include <linux/bug.h>
  10. #include <linux/string.h>
  11. #include <asm/types.h>
  12. #define VT_BUF_HAVE_RW
  13. #define VT_BUF_HAVE_MEMSETW
  14. #define VT_BUF_HAVE_MEMCPYW
  15. #define VT_BUF_HAVE_MEMMOVEW
  16. #undef scr_writew
  17. #undef scr_readw
  18. static inline void scr_writew(u16 val, u16 *addr)
  19. {
  20. BUG_ON((long) addr >= 0);
  21. *addr = val;
  22. }
  23. static inline u16 scr_readw(const u16 *addr)
  24. {
  25. BUG_ON((long) addr >= 0);
  26. return *addr;
  27. }
  28. static inline void scr_memsetw(u16 *p, u16 v, unsigned int n)
  29. {
  30. BUG_ON((long) p >= 0);
  31. memset16(p, cpu_to_le16(v), n / 2);
  32. }
  33. static inline void scr_memcpyw(u16 *d, u16 *s, unsigned int n)
  34. {
  35. BUG_ON((long) d >= 0);
  36. memcpy(d, s, n);
  37. }
  38. static inline void scr_memmovew(u16 *d, u16 *s, unsigned int n)
  39. {
  40. BUG_ON((long) d >= 0);
  41. memmove(d, s, n);
  42. }
  43. #define VGA_MAP_MEM(x,s) (x)
  44. #endif