diff options
author | Matt Mackall <mpm@selenic.com> | 2008-02-05 01:29:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-05 12:44:16 -0500 |
commit | e6473092bd9116583ce9ab8cf1b6570e1aa6fc83 (patch) | |
tree | e91a7ca6ce89f24a4a2d500d748dabf727c61887 /include/linux/mm.h | |
parent | 698dd4ba6b12e34e1e432c944c01478c0b2cd773 (diff) |
maps4: introduce a generic page walker
Introduce a general page table walker
Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index bcbe6979ff65..89d7c691b93a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -718,6 +718,28 @@ unsigned long unmap_vmas(struct mmu_gather **tlb, | |||
718 | struct vm_area_struct *start_vma, unsigned long start_addr, | 718 | struct vm_area_struct *start_vma, unsigned long start_addr, |
719 | unsigned long end_addr, unsigned long *nr_accounted, | 719 | unsigned long end_addr, unsigned long *nr_accounted, |
720 | struct zap_details *); | 720 | struct zap_details *); |
721 | |||
722 | /** | ||
723 | * mm_walk - callbacks for walk_page_range | ||
724 | * @pgd_entry: if set, called for each non-empty PGD (top-level) entry | ||
725 | * @pud_entry: if set, called for each non-empty PUD (2nd-level) entry | ||
726 | * @pmd_entry: if set, called for each non-empty PMD (3rd-level) entry | ||
727 | * @pte_entry: if set, called for each non-empty PTE (4th-level) entry | ||
728 | * @pte_hole: if set, called for each hole at all levels | ||
729 | * | ||
730 | * (see walk_page_range for more details) | ||
731 | */ | ||
732 | struct mm_walk { | ||
733 | int (*pgd_entry)(pgd_t *, unsigned long, unsigned long, void *); | ||
734 | int (*pud_entry)(pud_t *, unsigned long, unsigned long, void *); | ||
735 | int (*pmd_entry)(pmd_t *, unsigned long, unsigned long, void *); | ||
736 | int (*pte_entry)(pte_t *, unsigned long, unsigned long, void *); | ||
737 | int (*pte_hole)(unsigned long, unsigned long, void *); | ||
738 | }; | ||
739 | |||
740 | int walk_page_range(const struct mm_struct *, unsigned long addr, | ||
741 | unsigned long end, const struct mm_walk *walk, | ||
742 | void *private); | ||
721 | void free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | 743 | void free_pgd_range(struct mmu_gather **tlb, unsigned long addr, |
722 | unsigned long end, unsigned long floor, unsigned long ceiling); | 744 | unsigned long end, unsigned long floor, unsigned long ceiling); |
723 | void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *start_vma, | 745 | void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *start_vma, |