1*146b7cdbSGreg Ungerer #ifndef _ASM_FB_H_ 2*146b7cdbSGreg Ungerer #define _ASM_FB_H_ 3*146b7cdbSGreg Ungerer 4*146b7cdbSGreg Ungerer #include <linux/fb.h> 5*146b7cdbSGreg Ungerer #include <linux/fs.h> 6*146b7cdbSGreg Ungerer #include <asm/page.h> 7*146b7cdbSGreg Ungerer #include <asm/setup.h> 8*146b7cdbSGreg Ungerer 9*146b7cdbSGreg Ungerer #ifdef CONFIG_MMU 10*146b7cdbSGreg Ungerer #ifdef CONFIG_SUN3 11*146b7cdbSGreg Ungerer static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, 12*146b7cdbSGreg Ungerer unsigned long off) 13*146b7cdbSGreg Ungerer { 14*146b7cdbSGreg Ungerer pgprot_val(vma->vm_page_prot) |= SUN3_PAGE_NOCACHE; 15*146b7cdbSGreg Ungerer } 1649148020SSam Ravnborg #else 17*146b7cdbSGreg Ungerer static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, 18*146b7cdbSGreg Ungerer unsigned long off) 19*146b7cdbSGreg Ungerer { 20*146b7cdbSGreg Ungerer if (CPU_IS_020_OR_030) 21*146b7cdbSGreg Ungerer pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE030; 22*146b7cdbSGreg Ungerer if (CPU_IS_040_OR_060) { 23*146b7cdbSGreg Ungerer pgprot_val(vma->vm_page_prot) &= _CACHEMASK040; 24*146b7cdbSGreg Ungerer /* Use no-cache mode, serialized */ 25*146b7cdbSGreg Ungerer pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE_S; 26*146b7cdbSGreg Ungerer } 27*146b7cdbSGreg Ungerer } 28*146b7cdbSGreg Ungerer #endif /* CONFIG_SUN3 */ 29*146b7cdbSGreg Ungerer #else 30*146b7cdbSGreg Ungerer #define fb_pgprotect(...) do {} while (0) 31*146b7cdbSGreg Ungerer #endif /* CONFIG_MMU */ 32*146b7cdbSGreg Ungerer 33*146b7cdbSGreg Ungerer static inline int fb_is_primary_device(struct fb_info *info) 34*146b7cdbSGreg Ungerer { 35*146b7cdbSGreg Ungerer return 0; 36*146b7cdbSGreg Ungerer } 37*146b7cdbSGreg Ungerer 38*146b7cdbSGreg Ungerer #endif /* _ASM_FB_H_ */ 39