xref: /openbmc/linux/arch/m68k/include/asm/fb.h (revision 0791faebfe750292a8a842b64795a390ca4a3b51)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2146b7cdbSGreg Ungerer #ifndef _ASM_FB_H_
3146b7cdbSGreg Ungerer #define _ASM_FB_H_
4146b7cdbSGreg Ungerer 
5146b7cdbSGreg Ungerer #include <asm/page.h>
6146b7cdbSGreg Ungerer #include <asm/setup.h>
7146b7cdbSGreg Ungerer 
8*db216477SThomas Zimmermann struct file;
9*db216477SThomas Zimmermann 
fb_pgprotect(struct file * file,struct vm_area_struct * vma,unsigned long off)10d8475179SThomas Zimmermann static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
11d8475179SThomas Zimmermann 				unsigned long off)
12d8475179SThomas Zimmermann {
13146b7cdbSGreg Ungerer #ifdef CONFIG_MMU
14146b7cdbSGreg Ungerer #ifdef CONFIG_SUN3
15146b7cdbSGreg Ungerer 	pgprot_val(vma->vm_page_prot) |= SUN3_PAGE_NOCACHE;
1649148020SSam Ravnborg #else
17146b7cdbSGreg Ungerer 	if (CPU_IS_020_OR_030)
18146b7cdbSGreg Ungerer 		pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE030;
19146b7cdbSGreg Ungerer 	if (CPU_IS_040_OR_060) {
20146b7cdbSGreg Ungerer 		pgprot_val(vma->vm_page_prot) &= _CACHEMASK040;
21146b7cdbSGreg Ungerer 		/* Use no-cache mode, serialized */
22146b7cdbSGreg Ungerer 		pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE_S;
23146b7cdbSGreg Ungerer 	}
24146b7cdbSGreg Ungerer #endif /* CONFIG_SUN3 */
25146b7cdbSGreg Ungerer #endif /* CONFIG_MMU */
26d8475179SThomas Zimmermann }
27*db216477SThomas Zimmermann #define fb_pgprotect fb_pgprotect
28146b7cdbSGreg Ungerer 
29*db216477SThomas Zimmermann #include <asm-generic/fb.h>
30146b7cdbSGreg Ungerer 
31146b7cdbSGreg Ungerer #endif /* _ASM_FB_H_ */
32