xref: /openbmc/linux/arch/ia64/include/asm/fb.h (revision 20d54e48)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
27f30491cSTony Luck #ifndef _ASM_FB_H_
37f30491cSTony Luck #define _ASM_FB_H_
47f30491cSTony Luck 
58f8eaa1bSThomas Zimmermann #include <linux/compiler.h>
67f30491cSTony Luck #include <linux/efi.h>
78f8eaa1bSThomas Zimmermann #include <linux/string.h>
881ea5144SThomas Zimmermann 
97f30491cSTony Luck #include <asm/page.h>
107f30491cSTony Luck 
1181ea5144SThomas Zimmermann struct file;
1281ea5144SThomas Zimmermann 
fb_pgprotect(struct file * file,struct vm_area_struct * vma,unsigned long off)137f30491cSTony Luck static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
147f30491cSTony Luck 				unsigned long off)
157f30491cSTony Luck {
167f30491cSTony Luck 	if (efi_range_is_wc(vma->vm_start, vma->vm_end - vma->vm_start))
177f30491cSTony Luck 		vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
187f30491cSTony Luck 	else
197f30491cSTony Luck 		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
207f30491cSTony Luck }
2181ea5144SThomas Zimmermann #define fb_pgprotect fb_pgprotect
227f30491cSTony Luck 
fb_memcpy_fromio(void * to,const volatile void __iomem * from,size_t n)23*20d54e48SThomas Zimmermann static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
248f8eaa1bSThomas Zimmermann {
258f8eaa1bSThomas Zimmermann 	memcpy(to, (void __force *)from, n);
268f8eaa1bSThomas Zimmermann }
27*20d54e48SThomas Zimmermann #define fb_memcpy_fromio fb_memcpy_fromio
288f8eaa1bSThomas Zimmermann 
fb_memcpy_toio(volatile void __iomem * to,const void * from,size_t n)29*20d54e48SThomas Zimmermann static inline void fb_memcpy_toio(volatile void __iomem *to, const void *from, size_t n)
308f8eaa1bSThomas Zimmermann {
318f8eaa1bSThomas Zimmermann 	memcpy((void __force *)to, from, n);
328f8eaa1bSThomas Zimmermann }
33*20d54e48SThomas Zimmermann #define fb_memcpy_toio fb_memcpy_toio
348f8eaa1bSThomas Zimmermann 
fb_memset_io(volatile void __iomem * addr,int c,size_t n)35*20d54e48SThomas Zimmermann static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n)
368f8eaa1bSThomas Zimmermann {
378f8eaa1bSThomas Zimmermann 	memset((void __force *)addr, c, n);
388f8eaa1bSThomas Zimmermann }
39*20d54e48SThomas Zimmermann #define fb_memset fb_memset_io
408f8eaa1bSThomas Zimmermann 
4181ea5144SThomas Zimmermann #include <asm-generic/fb.h>
427f30491cSTony Luck 
437f30491cSTony Luck #endif /* _ASM_FB_H_ */
44