File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99#include <asm/page.h>
1010
11- struct file ;
12-
13- static inline void fb_pgprotect (struct file * file , struct vm_area_struct * vma ,
14- unsigned long off )
11+ static inline pgprot_t pgprot_framebuffer (pgprot_t prot ,
12+ unsigned long vm_start , unsigned long vm_end ,
13+ unsigned long offset )
1514{
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 );
15+ if (efi_range_is_wc (vm_start , vm_end - vm_start ))
16+ return pgprot_writecombine (prot );
1817 else
19- vma -> vm_page_prot = pgprot_noncached (vma -> vm_page_prot );
18+ return pgprot_noncached (prot );
2019}
21- #define fb_pgprotect fb_pgprotect
20+ #define pgprot_framebuffer pgprot_framebuffer
2221
2322static inline void fb_memcpy_fromio (void * to , const volatile void __iomem * from , size_t n )
2423{
Original file line number Diff line number Diff line change 55#include <asm/page.h>
66#include <asm/setup.h>
77
8- struct file ;
9-
10- static inline void fb_pgprotect (struct file * file , struct vm_area_struct * vma ,
11- unsigned long off )
8+ static inline pgprot_t pgprot_framebuffer (pgprot_t prot ,
9+ unsigned long vm_start , unsigned long vm_end ,
10+ unsigned long offset )
1211{
1312#ifdef CONFIG_MMU
1413#ifdef CONFIG_SUN3
15- pgprot_val (vma -> vm_page_prot ) |= SUN3_PAGE_NOCACHE ;
14+ pgprot_val (prot ) |= SUN3_PAGE_NOCACHE ;
1615#else
1716 if (CPU_IS_020_OR_030 )
18- pgprot_val (vma -> vm_page_prot ) |= _PAGE_NOCACHE030 ;
17+ pgprot_val (prot ) |= _PAGE_NOCACHE030 ;
1918 if (CPU_IS_040_OR_060 ) {
20- pgprot_val (vma -> vm_page_prot ) &= _CACHEMASK040 ;
19+ pgprot_val (prot ) &= _CACHEMASK040 ;
2120 /* Use no-cache mode, serialized */
22- pgprot_val (vma -> vm_page_prot ) |= _PAGE_NOCACHE_S ;
21+ pgprot_val (prot ) |= _PAGE_NOCACHE_S ;
2322 }
2423#endif /* CONFIG_SUN3 */
2524#endif /* CONFIG_MMU */
25+
26+ return prot ;
2627}
27- #define fb_pgprotect fb_pgprotect
28+ #define pgprot_framebuffer pgprot_framebuffer
2829
2930#include <asm-generic/fb.h>
3031
Original file line number Diff line number Diff line change 33
44#include <asm/page.h>
55
6- struct file ;
7-
8- static inline void fb_pgprotect (struct file * file , struct vm_area_struct * vma ,
9- unsigned long off )
6+ static inline pgprot_t pgprot_framebuffer (pgprot_t prot ,
7+ unsigned long vm_start , unsigned long vm_end ,
8+ unsigned long offset )
109{
11- vma -> vm_page_prot = pgprot_noncached (vma -> vm_page_prot );
10+ return pgprot_noncached (prot );
1211}
13- #define fb_pgprotect fb_pgprotect
12+ #define pgprot_framebuffer pgprot_framebuffer
1413
1514/*
1615 * MIPS doesn't define __raw_ I/O macros, so the helpers
Original file line number Diff line number Diff line change 22#ifndef _ASM_FB_H_
33#define _ASM_FB_H_
44
5- #include <linux/fs.h>
6-
75#include <asm/page.h>
86
9- static inline void fb_pgprotect (struct file * file , struct vm_area_struct * vma ,
10- unsigned long off )
7+ static inline pgprot_t pgprot_framebuffer (pgprot_t prot ,
8+ unsigned long vm_start , unsigned long vm_end ,
9+ unsigned long offset )
1110{
1211 /*
1312 * PowerPC's implementation of phys_mem_access_prot() does
1413 * not use the file argument. Set it to NULL in preparation
1514 * of later updates to the interface.
1615 */
17- vma -> vm_page_prot = phys_mem_access_prot (NULL , PHYS_PFN (off ),
18- vma -> vm_end - vma -> vm_start ,
19- vma -> vm_page_prot );
16+ return phys_mem_access_prot (NULL , PHYS_PFN (offset ), vm_end - vm_start , prot );
2017}
21- #define fb_pgprotect fb_pgprotect
18+ #define pgprot_framebuffer pgprot_framebuffer
2219
2320#include <asm-generic/fb.h>
2421
Original file line number Diff line number Diff line change 44
55#include <linux/io.h>
66
7+ #include <asm/page.h>
8+
79struct fb_info ;
8- struct file ;
9- struct vm_area_struct ;
1010
1111#ifdef CONFIG_SPARC32
12- static inline void fb_pgprotect (struct file * file , struct vm_area_struct * vma ,
13- unsigned long off )
14- { }
15- #define fb_pgprotect fb_pgprotect
12+ static inline pgprot_t pgprot_framebuffer (pgprot_t prot ,
13+ unsigned long vm_start , unsigned long vm_end ,
14+ unsigned long offset )
15+ {
16+ return prot ;
17+ }
18+ #define pgprot_framebuffer pgprot_framebuffer
1619#endif
1720
1821int fb_is_primary_device (struct fb_info * info );
Original file line number Diff line number Diff line change 22#ifndef _ASM_X86_FB_H
33#define _ASM_X86_FB_H
44
5+ #include <asm/page.h>
6+
57struct fb_info ;
6- struct file ;
7- struct vm_area_struct ;
88
9- void fb_pgprotect (struct file * file , struct vm_area_struct * vma , unsigned long off );
10- #define fb_pgprotect fb_pgprotect
9+ pgprot_t pgprot_framebuffer (pgprot_t prot ,
10+ unsigned long vm_start , unsigned long vm_end ,
11+ unsigned long offset );
12+ #define pgprot_framebuffer pgprot_framebuffer
1113
1214int fb_is_primary_device (struct fb_info * info );
1315#define fb_is_primary_device fb_is_primary_device
Original file line number Diff line number Diff line change 1313#include <linux/vgaarb.h>
1414#include <asm/fb.h>
1515
16- void fb_pgprotect (struct file * file , struct vm_area_struct * vma , unsigned long off )
16+ pgprot_t pgprot_framebuffer (pgprot_t prot ,
17+ unsigned long vm_start , unsigned long vm_end ,
18+ unsigned long offset )
1719{
18- unsigned long prot ;
19-
20- prot = pgprot_val (vma -> vm_page_prot ) & ~_PAGE_CACHE_MASK ;
20+ pgprot_val (prot ) &= ~_PAGE_CACHE_MASK ;
2121 if (boot_cpu_data .x86 > 3 )
22- pgprot_val (vma -> vm_page_prot ) =
23- prot | cachemode2protval (_PAGE_CACHE_MODE_UC_MINUS );
22+ pgprot_val (prot ) |= cachemode2protval (_PAGE_CACHE_MODE_UC_MINUS );
23+
24+ return prot ;
2425}
25- EXPORT_SYMBOL (fb_pgprotect );
26+ EXPORT_SYMBOL (pgprot_framebuffer );
2627
2728int fb_is_primary_device (struct fb_info * info )
2829{
Original file line number Diff line number Diff line change @@ -365,7 +365,8 @@ static int fb_mmap(struct file *file, struct vm_area_struct *vma)
365365 mutex_unlock (& info -> mm_lock );
366366
367367 vma -> vm_page_prot = vm_get_page_prot (vma -> vm_flags );
368- fb_pgprotect (file , vma , start );
368+ vma -> vm_page_prot = pgprot_framebuffer (vma -> vm_page_prot , vma -> vm_start ,
369+ vma -> vm_end , start );
369370
370371 return vm_iomap_memory (vma , start , len );
371372}
Original file line number Diff line number Diff line change 1212#include <linux/pgtable.h>
1313
1414struct fb_info ;
15- struct file ;
1615
17- #ifndef fb_pgprotect
18- #define fb_pgprotect fb_pgprotect
19- static inline void fb_pgprotect (struct file * file , struct vm_area_struct * vma ,
20- unsigned long off )
16+ #ifndef pgprot_framebuffer
17+ #define pgprot_framebuffer pgprot_framebuffer
18+ static inline pgprot_t pgprot_framebuffer (pgprot_t prot ,
19+ unsigned long vm_start , unsigned long vm_end ,
20+ unsigned long offset )
2121{
22- vma -> vm_page_prot = pgprot_writecombine (vma -> vm_page_prot );
22+ return pgprot_writecombine (prot );
2323}
2424#endif
2525
You can’t perform that action at this time.
0 commit comments