diff options
| -rw-r--r-- | arch/csky/include/asm/pgtable.h | 5 | ||||
| -rw-r--r-- | arch/csky/mm/ioremap.c | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/arch/csky/include/asm/pgtable.h b/arch/csky/include/asm/pgtable.h index af7a7faa1010..dcea277c09ae 100644 --- a/arch/csky/include/asm/pgtable.h +++ b/arch/csky/include/asm/pgtable.h | |||
| @@ -241,6 +241,11 @@ static inline pte_t pte_mkyoung(pte_t pte) | |||
| 241 | 241 | ||
| 242 | #define pgd_index(address) ((address) >> PGDIR_SHIFT) | 242 | #define pgd_index(address) ((address) >> PGDIR_SHIFT) |
| 243 | 243 | ||
| 244 | #define __HAVE_PHYS_MEM_ACCESS_PROT | ||
| 245 | struct file; | ||
| 246 | extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | ||
| 247 | unsigned long size, pgprot_t vma_prot); | ||
| 248 | |||
| 244 | /* | 249 | /* |
| 245 | * Macro to make mark a page protection value as "uncacheable". Note | 250 | * Macro to make mark a page protection value as "uncacheable". Note |
| 246 | * that "protection" is really a misnomer here as the protection value | 251 | * that "protection" is really a misnomer here as the protection value |
diff --git a/arch/csky/mm/ioremap.c b/arch/csky/mm/ioremap.c index cb7c03e5cd21..8473b6bdf512 100644 --- a/arch/csky/mm/ioremap.c +++ b/arch/csky/mm/ioremap.c | |||
| @@ -46,3 +46,17 @@ void iounmap(void __iomem *addr) | |||
| 46 | vunmap((void *)((unsigned long)addr & PAGE_MASK)); | 46 | vunmap((void *)((unsigned long)addr & PAGE_MASK)); |
| 47 | } | 47 | } |
| 48 | EXPORT_SYMBOL(iounmap); | 48 | EXPORT_SYMBOL(iounmap); |
| 49 | |||
| 50 | pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | ||
| 51 | unsigned long size, pgprot_t vma_prot) | ||
| 52 | { | ||
| 53 | if (!pfn_valid(pfn)) { | ||
| 54 | vma_prot.pgprot |= _PAGE_SO; | ||
| 55 | return pgprot_noncached(vma_prot); | ||
| 56 | } else if (file->f_flags & O_SYNC) { | ||
| 57 | return pgprot_noncached(vma_prot); | ||
| 58 | } | ||
| 59 | |||
| 60 | return vma_prot; | ||
| 61 | } | ||
| 62 | EXPORT_SYMBOL(phys_mem_access_prot); | ||
