xref: /openbmc/linux/arch/loongarch/include/asm/fb.h (revision 20d54e48)
17153c3cbSHuacai Chen /* SPDX-License-Identifier: GPL-2.0 */
27153c3cbSHuacai Chen /*
37153c3cbSHuacai Chen  * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
47153c3cbSHuacai Chen  */
57153c3cbSHuacai Chen #ifndef _ASM_FB_H_
67153c3cbSHuacai Chen #define _ASM_FB_H_
77153c3cbSHuacai Chen 
88f8eaa1bSThomas Zimmermann #include <linux/compiler.h>
98f8eaa1bSThomas Zimmermann #include <linux/string.h>
108f8eaa1bSThomas Zimmermann 
fb_memcpy_fromio(void * to,const volatile void __iomem * from,size_t n)11*20d54e48SThomas Zimmermann static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
128f8eaa1bSThomas Zimmermann {
138f8eaa1bSThomas Zimmermann 	memcpy(to, (void __force *)from, n);
148f8eaa1bSThomas Zimmermann }
15*20d54e48SThomas Zimmermann #define fb_memcpy_fromio fb_memcpy_fromio
168f8eaa1bSThomas Zimmermann 
fb_memcpy_toio(volatile void __iomem * to,const void * from,size_t n)17*20d54e48SThomas Zimmermann static inline void fb_memcpy_toio(volatile void __iomem *to, const void *from, size_t n)
188f8eaa1bSThomas Zimmermann {
198f8eaa1bSThomas Zimmermann 	memcpy((void __force *)to, from, n);
208f8eaa1bSThomas Zimmermann }
21*20d54e48SThomas Zimmermann #define fb_memcpy_toio fb_memcpy_toio
228f8eaa1bSThomas Zimmermann 
fb_memset_io(volatile void __iomem * addr,int c,size_t n)23*20d54e48SThomas Zimmermann static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n)
248f8eaa1bSThomas Zimmermann {
258f8eaa1bSThomas Zimmermann 	memset((void __force *)addr, c, n);
268f8eaa1bSThomas Zimmermann }
27*20d54e48SThomas Zimmermann #define fb_memset fb_memset_io
288f8eaa1bSThomas Zimmermann 
2984998fc1SThomas Zimmermann #include <asm-generic/fb.h>
307153c3cbSHuacai Chen 
317153c3cbSHuacai Chen #endif /* _ASM_FB_H_ */
32