aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/pgtable.h
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-11-26 12:39:28 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-11-26 12:43:18 -0500
commiteb9b2b69d3bdfe9cd98cd9b2c5715346a0f0140d (patch)
tree47f346103656c711e81351faee1a117da5241960 /arch/arm/include/asm/pgtable.h
parentc0ba10b512eb2e2a3888b6e6cc0e089f5e7a191b (diff)
ARM: pgtable: move pgprot functions to one place
Rather than scattering them throughout the file, group them together. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/include/asm/pgtable.h')
-rw-r--r--arch/arm/include/asm/pgtable.h43
1 files changed, 21 insertions, 22 deletions
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 53d1d5deb111..3a53d495874b 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -219,6 +219,27 @@ extern pgprot_t pgprot_kernel;
219#define __PAGE_READONLY __pgprot(_L_PTE_DEFAULT | L_PTE_USER) 219#define __PAGE_READONLY __pgprot(_L_PTE_DEFAULT | L_PTE_USER)
220#define __PAGE_READONLY_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_EXEC) 220#define __PAGE_READONLY_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_EXEC)
221 221
222#define __pgprot_modify(prot,mask,bits) \
223 __pgprot((pgprot_val(prot) & ~(mask)) | (bits))
224
225#define pgprot_noncached(prot) \
226 __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED)
227
228#define pgprot_writecombine(prot) \
229 __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE)
230
231#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
232#define pgprot_dmacoherent(prot) \
233 __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE)
234#define __HAVE_PHYS_MEM_ACCESS_PROT
235struct file;
236extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
237 unsigned long size, pgprot_t vma_prot);
238#else
239#define pgprot_dmacoherent(prot) \
240 __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_UNCACHED)
241#endif
242
222#endif /* __ASSEMBLY__ */ 243#endif /* __ASSEMBLY__ */
223 244
224/* 245/*
@@ -322,28 +343,6 @@ PTE_BIT_FUNC(mkyoung, |= L_PTE_YOUNG);
322 343
323static inline pte_t pte_mkspecial(pte_t pte) { return pte; } 344static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
324 345
325#define __pgprot_modify(prot,mask,bits) \
326 __pgprot((pgprot_val(prot) & ~(mask)) | (bits))
327
328/*
329 * Mark the prot value as uncacheable and unbufferable.
330 */
331#define pgprot_noncached(prot) \
332 __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED)
333#define pgprot_writecombine(prot) \
334 __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE)
335#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
336#define pgprot_dmacoherent(prot) \
337 __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE)
338#define __HAVE_PHYS_MEM_ACCESS_PROT
339struct file;
340extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
341 unsigned long size, pgprot_t vma_prot);
342#else
343#define pgprot_dmacoherent(prot) \
344 __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_UNCACHED)
345#endif
346
347#define pmd_none(pmd) (!pmd_val(pmd)) 346#define pmd_none(pmd) (!pmd_val(pmd))
348#define pmd_present(pmd) (pmd_val(pmd)) 347#define pmd_present(pmd) (pmd_val(pmd))
349#define pmd_bad(pmd) (pmd_val(pmd) & 2) 348#define pmd_bad(pmd) (pmd_val(pmd) & 2)