aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/pgtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/include/asm/pgtable.h')
-rw-r--r--arch/arm/include/asm/pgtable.h43
1 files changed, 6 insertions, 37 deletions
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index a784859cc7a9..3f2f0eb76211 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -11,19 +11,24 @@
11#define _ASMARM_PGTABLE_H 11#define _ASMARM_PGTABLE_H
12 12
13#include <linux/const.h> 13#include <linux/const.h>
14#include <asm-generic/4level-fixup.h>
15#include <asm/proc-fns.h> 14#include <asm/proc-fns.h>
16 15
17#ifndef CONFIG_MMU 16#ifndef CONFIG_MMU
18 17
18#include <asm-generic/4level-fixup.h>
19#include "pgtable-nommu.h" 19#include "pgtable-nommu.h"
20 20
21#else 21#else
22 22
23#include <asm-generic/pgtable-nopud.h>
23#include <asm/memory.h> 24#include <asm/memory.h>
24#include <asm/pgtable-hwdef.h> 25#include <asm/pgtable-hwdef.h>
25 26
27#ifdef CONFIG_ARM_LPAE
28#include <asm/pgtable-3level.h>
29#else
26#include <asm/pgtable-2level.h> 30#include <asm/pgtable-2level.h>
31#endif
27 32
28/* 33/*
29 * Just any arbitrary offset to the start of the vmalloc VM area: the 34 * Just any arbitrary offset to the start of the vmalloc VM area: the
@@ -164,39 +169,8 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
164/* to find an entry in a kernel page-table-directory */ 169/* to find an entry in a kernel page-table-directory */
165#define pgd_offset_k(addr) pgd_offset(&init_mm, addr) 170#define pgd_offset_k(addr) pgd_offset(&init_mm, addr)
166 171
167/*
168 * The "pgd_xxx()" functions here are trivial for a folded two-level
169 * setup: the pgd is never bad, and a pmd always exists (as it's folded
170 * into the pgd entry)
171 */
172#define pgd_none(pgd) (0)
173#define pgd_bad(pgd) (0)
174#define pgd_present(pgd) (1)
175#define pgd_clear(pgdp) do { } while (0)
176#define set_pgd(pgd,pgdp) do { } while (0)
177#define set_pud(pud,pudp) do { } while (0)
178
179
180/* Find an entry in the second-level page table.. */
181#define pmd_offset(dir, addr) ((pmd_t *)(dir))
182
183#define pmd_none(pmd) (!pmd_val(pmd)) 172#define pmd_none(pmd) (!pmd_val(pmd))
184#define pmd_present(pmd) (pmd_val(pmd)) 173#define pmd_present(pmd) (pmd_val(pmd))
185#define pmd_bad(pmd) (pmd_val(pmd) & 2)
186
187#define copy_pmd(pmdpd,pmdps) \
188 do { \
189 pmdpd[0] = pmdps[0]; \
190 pmdpd[1] = pmdps[1]; \
191 flush_pmd_entry(pmdpd); \
192 } while (0)
193
194#define pmd_clear(pmdp) \
195 do { \
196 pmdp[0] = __pmd(0); \
197 pmdp[1] = __pmd(0); \
198 clean_pmd_entry(pmdp); \
199 } while (0)
200 174
201static inline pte_t *pmd_page_vaddr(pmd_t pmd) 175static inline pte_t *pmd_page_vaddr(pmd_t pmd)
202{ 176{
@@ -205,10 +179,6 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd)
205 179
206#define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK)) 180#define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK))
207 181
208/* we don't need complex calculations here as the pmd is folded into the pgd */
209#define pmd_addr_end(addr,end) (end)
210
211
212#ifndef CONFIG_HIGHPTE 182#ifndef CONFIG_HIGHPTE
213#define __pte_map(pmd) pmd_page_vaddr(*(pmd)) 183#define __pte_map(pmd) pmd_page_vaddr(*(pmd))
214#define __pte_unmap(pte) do { } while (0) 184#define __pte_unmap(pte) do { } while (0)
@@ -230,7 +200,6 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd)
230#define pte_page(pte) pfn_to_page(pte_pfn(pte)) 200#define pte_page(pte) pfn_to_page(pte_pfn(pte))
231#define mk_pte(page,prot) pfn_pte(page_to_pfn(page), prot) 201#define mk_pte(page,prot) pfn_pte(page_to_pfn(page), prot)
232 202
233#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext)
234#define pte_clear(mm,addr,ptep) set_pte_ext(ptep, __pte(0), 0) 203#define pte_clear(mm,addr,ptep) set_pte_ext(ptep, __pte(0), 0)
235 204
236#if __LINUX_ARM_ARCH__ < 6 205#if __LINUX_ARM_ARCH__ < 6