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 15:12:12 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-11-26 15:17:33 -0500
commit4eec4b1396ac6a6a602b4521d40e9cf596ab776d (patch)
treed7922345b7c6c03f4ab5a918f447186b7ea2729b /arch/arm/include/asm/pgtable.h
parenteb9b2b69d3bdfe9cd98cd9b2c5715346a0f0140d (diff)
ARM: pgtable: group pgd functions and data 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.h44
1 files changed, 23 insertions, 21 deletions
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 3a53d495874b..8ee9dce10b83 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -276,6 +276,29 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
276extern struct page *empty_zero_page; 276extern struct page *empty_zero_page;
277#define ZERO_PAGE(vaddr) (empty_zero_page) 277#define ZERO_PAGE(vaddr) (empty_zero_page)
278 278
279
280extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
281
282/* to find an entry in a page-table-directory */
283#define pgd_index(addr) ((addr) >> PGDIR_SHIFT)
284
285#define pgd_offset(mm, addr) ((mm)->pgd + pgd_index(addr))
286
287/* to find an entry in a kernel page-table-directory */
288#define pgd_offset_k(addr) pgd_offset(&init_mm, addr)
289
290/*
291 * The "pgd_xxx()" functions here are trivial for a folded two-level
292 * setup: the pgd is never bad, and a pmd always exists (as it's folded
293 * into the pgd entry)
294 */
295#define pgd_none(pgd) (0)
296#define pgd_bad(pgd) (0)
297#define pgd_present(pgd) (1)
298#define pgd_clear(pgdp) do { } while (0)
299#define set_pgd(pgd,pgdp) do { } while (0)
300
301
279#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT) 302#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
280#define pfn_pte(pfn,prot) (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))) 303#define pfn_pte(pfn,prot) (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)))
281 304
@@ -382,25 +405,6 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd)
382 */ 405 */
383#define mk_pte(page,prot) pfn_pte(page_to_pfn(page),prot) 406#define mk_pte(page,prot) pfn_pte(page_to_pfn(page),prot)
384 407
385/*
386 * The "pgd_xxx()" functions here are trivial for a folded two-level
387 * setup: the pgd is never bad, and a pmd always exists (as it's folded
388 * into the pgd entry)
389 */
390#define pgd_none(pgd) (0)
391#define pgd_bad(pgd) (0)
392#define pgd_present(pgd) (1)
393#define pgd_clear(pgdp) do { } while (0)
394#define set_pgd(pgd,pgdp) do { } while (0)
395
396/* to find an entry in a page-table-directory */
397#define pgd_index(addr) ((addr) >> PGDIR_SHIFT)
398
399#define pgd_offset(mm, addr) ((mm)->pgd+pgd_index(addr))
400
401/* to find an entry in a kernel page-table-directory */
402#define pgd_offset_k(addr) pgd_offset(&init_mm, addr)
403
404/* Find an entry in the second-level page table.. */ 408/* Find an entry in the second-level page table.. */
405#define pmd_offset(dir, addr) ((pmd_t *)(dir)) 409#define pmd_offset(dir, addr) ((pmd_t *)(dir))
406 410
@@ -414,8 +418,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
414 return pte; 418 return pte;
415} 419}
416 420
417extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
418
419/* 421/*
420 * Encode and decode a swap entry. Swap entries are stored in the Linux 422 * Encode and decode a swap entry. Swap entries are stored in the Linux
421 * page tables as follows: 423 * page tables as follows: