xref: /openbmc/linux/arch/ia64/include/asm/fb.h (revision ad4455c6)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_FB_H_
3 #define _ASM_FB_H_
4 
5 #include <linux/compiler.h>
6 #include <linux/efi.h>
7 #include <linux/string.h>
8 
9 #include <asm/page.h>
10 
11 struct file;
12 
13 static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
14 				unsigned long off)
15 {
16 	if (efi_range_is_wc(vma->vm_start, vma->vm_end - vma->vm_start))
17 		vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
18 	else
19 		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
20 }
21 #define fb_pgprotect fb_pgprotect
22 
23 static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
24 {
25 	memcpy(to, (void __force *)from, n);
26 }
27 #define fb_memcpy_fromio fb_memcpy_fromio
28 
29 static inline void fb_memcpy_toio(volatile void __iomem *to, const void *from, size_t n)
30 {
31 	memcpy((void __force *)to, from, n);
32 }
33 #define fb_memcpy_toio fb_memcpy_toio
34 
35 static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n)
36 {
37 	memset((void __force *)addr, c, n);
38 }
39 #define fb_memset fb_memset_io
40 
41 #include <asm-generic/fb.h>
42 
43 #endif /* _ASM_FB_H_ */
44