Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  *  Access to VGA videoram
0004  *
0005  *  (c) 1998 Martin Mares <mj@ucw.cz>
0006  */
0007 
0008 #ifndef _LINUX_ASM_VGA_H_
0009 #define _LINUX_ASM_VGA_H_
0010 
0011 #include <linux/bug.h>
0012 #include <linux/string.h>
0013 #include <asm/types.h>
0014 
0015 #define VT_BUF_HAVE_RW
0016 #define VT_BUF_HAVE_MEMSETW
0017 #define VT_BUF_HAVE_MEMCPYW
0018 #define VT_BUF_HAVE_MEMMOVEW
0019 
0020 #undef scr_writew
0021 #undef scr_readw
0022 
0023 static inline void scr_writew(u16 val, u16 *addr)
0024 {
0025     BUG_ON((long) addr >= 0);
0026 
0027     *addr = val;
0028 }
0029 
0030 static inline u16 scr_readw(const u16 *addr)
0031 {
0032     BUG_ON((long) addr >= 0);
0033 
0034     return *addr;
0035 }
0036 
0037 static inline void scr_memsetw(u16 *p, u16 v, unsigned int n)
0038 {
0039     BUG_ON((long) p >= 0);
0040 
0041     memset16(p, cpu_to_le16(v), n / 2);
0042 }
0043 
0044 static inline void scr_memcpyw(u16 *d, u16 *s, unsigned int n)
0045 {
0046     BUG_ON((long) d >= 0);
0047 
0048     memcpy(d, s, n);
0049 }
0050 
0051 static inline void scr_memmovew(u16 *d, u16 *s, unsigned int n)
0052 {
0053     BUG_ON((long) d >= 0);
0054 
0055     memmove(d, s, n);
0056 }
0057 
0058 #define VGA_MAP_MEM(x,s) (x)
0059 
0060 #endif