aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/include
diff options
context:
space:
mode:
authorSteve Capper <Steve.Capper@arm.com>2014-01-15 09:07:12 -0500
committerCatalin Marinas <catalin.marinas@arm.com>2014-01-31 06:30:05 -0500
commit44b6dfc556811c0e6981329e29e1865fc7a8847d (patch)
tree373e32fb88309c42ebd9309967f99bf35fa637f4 /arch/arm64/include
parentf864b61ee49bbf3faf9a10b9770c719536328d01 (diff)
arm64: mm: Remove PTE_BIT_FUNC macro
Expand out the pte manipulation functions. This makes our life easier when using things like tags and cscope. Signed-off-by: Steve Capper <steve.capper@arm.com> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r--arch/arm64/include/asm/pgtable.h51
1 files changed, 41 insertions, 10 deletions
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 7f2b60affbb4..27c78395ae76 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -146,16 +146,47 @@ extern struct page *empty_zero_page;
146#define pte_valid_user(pte) \ 146#define pte_valid_user(pte) \
147 ((pte_val(pte) & (PTE_VALID | PTE_USER)) == (PTE_VALID | PTE_USER)) 147 ((pte_val(pte) & (PTE_VALID | PTE_USER)) == (PTE_VALID | PTE_USER))
148 148
149#define PTE_BIT_FUNC(fn,op) \ 149static inline pte_t pte_wrprotect(pte_t pte)
150static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; } 150{
151 151 pte_val(pte) |= PTE_RDONLY;
152PTE_BIT_FUNC(wrprotect, |= PTE_RDONLY); 152 return pte;
153PTE_BIT_FUNC(mkwrite, &= ~PTE_RDONLY); 153}
154PTE_BIT_FUNC(mkclean, &= ~PTE_DIRTY); 154
155PTE_BIT_FUNC(mkdirty, |= PTE_DIRTY); 155static inline pte_t pte_mkwrite(pte_t pte)
156PTE_BIT_FUNC(mkold, &= ~PTE_AF); 156{
157PTE_BIT_FUNC(mkyoung, |= PTE_AF); 157 pte_val(pte) &= ~PTE_RDONLY;
158PTE_BIT_FUNC(mkspecial, |= PTE_SPECIAL); 158 return pte;
159}
160
161static inline pte_t pte_mkclean(pte_t pte)
162{
163 pte_val(pte) &= ~PTE_DIRTY;
164 return pte;
165}
166
167static inline pte_t pte_mkdirty(pte_t pte)
168{
169 pte_val(pte) |= PTE_DIRTY;
170 return pte;
171}
172
173static inline pte_t pte_mkold(pte_t pte)
174{
175 pte_val(pte) &= ~PTE_AF;
176 return pte;
177}
178
179static inline pte_t pte_mkyoung(pte_t pte)
180{
181 pte_val(pte) |= PTE_AF;
182 return pte;
183}
184
185static inline pte_t pte_mkspecial(pte_t pte)
186{
187 pte_val(pte) |= PTE_SPECIAL;
188 return pte;
189}
159 190
160static inline void set_pte(pte_t *ptep, pte_t pte) 191static inline void set_pte(pte_t *ptep, pte_t pte)
161{ 192{