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