summaryrefslogtreecommitdiffstats
path: root/arch/arc/include
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-12-05 01:35:05 -0500
committerVineet Gupta <vgupta@synopsys.com>2015-10-09 07:34:22 -0400
commit129cbed54a8b3f80f0eaf49acb14fe835587f6f3 (patch)
tree09e9dd2fdec3ac785ff2e5f67d6ca62a42f59203 /arch/arc/include
parente8a75963a4b9433dca55286e222f4dd1cc1ca76c (diff)
ARC: mm: pte flags comsetic cleanups, comments
No semantical changes Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/include')
-rw-r--r--arch/arc/include/asm/pgtable.h37
1 files changed, 16 insertions, 21 deletions
diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h
index 1281718802f7..481359fe56ae 100644
--- a/arch/arc/include/asm/pgtable.h
+++ b/arch/arc/include/asm/pgtable.h
@@ -60,7 +60,7 @@
60#define _PAGE_EXECUTE (1<<3) /* Page has user execute perm (H) */ 60#define _PAGE_EXECUTE (1<<3) /* Page has user execute perm (H) */
61#define _PAGE_WRITE (1<<4) /* Page has user write perm (H) */ 61#define _PAGE_WRITE (1<<4) /* Page has user write perm (H) */
62#define _PAGE_READ (1<<5) /* Page has user read perm (H) */ 62#define _PAGE_READ (1<<5) /* Page has user read perm (H) */
63#define _PAGE_MODIFIED (1<<6) /* Page modified (dirty) (S) */ 63#define _PAGE_DIRTY (1<<6) /* Page modified (dirty) (S) */
64#define _PAGE_GLOBAL (1<<8) /* Page is global (H) */ 64#define _PAGE_GLOBAL (1<<8) /* Page is global (H) */
65#define _PAGE_PRESENT (1<<10) /* TLB entry is valid (H) */ 65#define _PAGE_PRESENT (1<<10) /* TLB entry is valid (H) */
66 66
@@ -71,7 +71,7 @@
71#define _PAGE_WRITE (1<<2) /* Page has user write perm (H) */ 71#define _PAGE_WRITE (1<<2) /* Page has user write perm (H) */
72#define _PAGE_READ (1<<3) /* Page has user read perm (H) */ 72#define _PAGE_READ (1<<3) /* Page has user read perm (H) */
73#define _PAGE_ACCESSED (1<<4) /* Page is accessed (S) */ 73#define _PAGE_ACCESSED (1<<4) /* Page is accessed (S) */
74#define _PAGE_MODIFIED (1<<5) /* Page modified (dirty) (S) */ 74#define _PAGE_DIRTY (1<<5) /* Page modified (dirty) (S) */
75 75
76#if (CONFIG_ARC_MMU_VER >= 4) 76#if (CONFIG_ARC_MMU_VER >= 4)
77#define _PAGE_WTHRU (1<<7) /* Page cache mode write-thru (H) */ 77#define _PAGE_WTHRU (1<<7) /* Page cache mode write-thru (H) */
@@ -92,21 +92,16 @@
92#define _K_PAGE_PERMS (_PAGE_EXECUTE | _PAGE_WRITE | _PAGE_READ | \ 92#define _K_PAGE_PERMS (_PAGE_EXECUTE | _PAGE_WRITE | _PAGE_READ | \
93 _PAGE_GLOBAL | _PAGE_PRESENT) 93 _PAGE_GLOBAL | _PAGE_PRESENT)
94 94
95#ifdef CONFIG_ARC_CACHE_PAGES 95#ifndef CONFIG_ARC_CACHE_PAGES
96#define _PAGE_DEF_CACHEABLE _PAGE_CACHEABLE 96#undef _PAGE_CACHEABLE
97#else 97#define _PAGE_CACHEABLE 0
98#define _PAGE_DEF_CACHEABLE (0)
99#endif 98#endif
100 99
101/* Helper for every "user" page 100/* Defaults for every user page */
102 * -kernel can R/W/X 101#define ___DEF (_PAGE_PRESENT | _PAGE_CACHEABLE)
103 * -by default cached, unless config otherwise
104 * -present in memory
105 */
106#define ___DEF (_PAGE_PRESENT | _PAGE_DEF_CACHEABLE)
107 102
108/* Set of bits not changed in pte_modify */ 103/* Set of bits not changed in pte_modify */
109#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED) 104#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
110 105
111/* More Abbrevaited helpers */ 106/* More Abbrevaited helpers */
112#define PAGE_U_NONE __pgprot(___DEF) 107#define PAGE_U_NONE __pgprot(___DEF)
@@ -122,7 +117,7 @@
122 * user vaddr space - visible in all addr spaces, but kernel mode only 117 * user vaddr space - visible in all addr spaces, but kernel mode only
123 * Thus Global, all-kernel-access, no-user-access, cached 118 * Thus Global, all-kernel-access, no-user-access, cached
124 */ 119 */
125#define PAGE_KERNEL __pgprot(_K_PAGE_PERMS | _PAGE_DEF_CACHEABLE) 120#define PAGE_KERNEL __pgprot(_K_PAGE_PERMS | _PAGE_CACHEABLE)
126 121
127/* ioremap */ 122/* ioremap */
128#define PAGE_KERNEL_NO_CACHE __pgprot(_K_PAGE_PERMS) 123#define PAGE_KERNEL_NO_CACHE __pgprot(_K_PAGE_PERMS)
@@ -191,16 +186,16 @@
191 186
192/* Optimal Sizing of Pg Tbl - based on MMU page size */ 187/* Optimal Sizing of Pg Tbl - based on MMU page size */
193#if defined(CONFIG_ARC_PAGE_SIZE_8K) 188#if defined(CONFIG_ARC_PAGE_SIZE_8K)
194#define BITS_FOR_PTE 8 189#define BITS_FOR_PTE 8 /* 11:8:13 */
195#elif defined(CONFIG_ARC_PAGE_SIZE_16K) 190#elif defined(CONFIG_ARC_PAGE_SIZE_16K)
196#define BITS_FOR_PTE 8 191#define BITS_FOR_PTE 8 /* 10:8:14 */
197#elif defined(CONFIG_ARC_PAGE_SIZE_4K) 192#elif defined(CONFIG_ARC_PAGE_SIZE_4K)
198#define BITS_FOR_PTE 9 193#define BITS_FOR_PTE 9 /* 11:9:12 */
199#endif 194#endif
200 195
201#define BITS_FOR_PGD (32 - BITS_FOR_PTE - BITS_IN_PAGE) 196#define BITS_FOR_PGD (32 - BITS_FOR_PTE - BITS_IN_PAGE)
202 197
203#define PGDIR_SHIFT (BITS_FOR_PTE + BITS_IN_PAGE) 198#define PGDIR_SHIFT (32 - BITS_FOR_PGD)
204#define PGDIR_SIZE (1UL << PGDIR_SHIFT) /* vaddr span, not PDG sz */ 199#define PGDIR_SIZE (1UL << PGDIR_SHIFT) /* vaddr span, not PDG sz */
205#define PGDIR_MASK (~(PGDIR_SIZE-1)) 200#define PGDIR_MASK (~(PGDIR_SIZE-1))
206 201
@@ -295,7 +290,7 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep)
295/* Zoo of pte_xxx function */ 290/* Zoo of pte_xxx function */
296#define pte_read(pte) (pte_val(pte) & _PAGE_READ) 291#define pte_read(pte) (pte_val(pte) & _PAGE_READ)
297#define pte_write(pte) (pte_val(pte) & _PAGE_WRITE) 292#define pte_write(pte) (pte_val(pte) & _PAGE_WRITE)
298#define pte_dirty(pte) (pte_val(pte) & _PAGE_MODIFIED) 293#define pte_dirty(pte) (pte_val(pte) & _PAGE_DIRTY)
299#define pte_young(pte) (pte_val(pte) & _PAGE_ACCESSED) 294#define pte_young(pte) (pte_val(pte) & _PAGE_ACCESSED)
300#define pte_special(pte) (0) 295#define pte_special(pte) (0)
301 296
@@ -304,8 +299,8 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep)
304 299
305PTE_BIT_FUNC(wrprotect, &= ~(_PAGE_WRITE)); 300PTE_BIT_FUNC(wrprotect, &= ~(_PAGE_WRITE));
306PTE_BIT_FUNC(mkwrite, |= (_PAGE_WRITE)); 301PTE_BIT_FUNC(mkwrite, |= (_PAGE_WRITE));
307PTE_BIT_FUNC(mkclean, &= ~(_PAGE_MODIFIED)); 302PTE_BIT_FUNC(mkclean, &= ~(_PAGE_DIRTY));
308PTE_BIT_FUNC(mkdirty, |= (_PAGE_MODIFIED)); 303PTE_BIT_FUNC(mkdirty, |= (_PAGE_DIRTY));
309PTE_BIT_FUNC(mkold, &= ~(_PAGE_ACCESSED)); 304PTE_BIT_FUNC(mkold, &= ~(_PAGE_ACCESSED));
310PTE_BIT_FUNC(mkyoung, |= (_PAGE_ACCESSED)); 305PTE_BIT_FUNC(mkyoung, |= (_PAGE_ACCESSED));
311PTE_BIT_FUNC(exprotect, &= ~(_PAGE_EXECUTE)); 306PTE_BIT_FUNC(exprotect, &= ~(_PAGE_EXECUTE));