diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-03-17 19:36:58 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-24 17:57:30 -0400 |
commit | 170fdff7057d4247e3f28cca96d0db1fbc854e3b (patch) | |
tree | b0d5281dc5de0b9a0ddb1e626818d8f7f562713c /include/asm-x86/pgalloc_32.h | |
parent | 397f687ab7f840dbe50353c4b60108672b653d0c (diff) |
x86: move pmd functions into common asm/pgalloc.h
Common definitions for 3-level pagetable functions.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/pgalloc_32.h')
-rw-r--r-- | include/asm-x86/pgalloc_32.h | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/include/asm-x86/pgalloc_32.h b/include/asm-x86/pgalloc_32.h index 96a09f566155..b83bc010af09 100644 --- a/include/asm-x86/pgalloc_32.h +++ b/include/asm-x86/pgalloc_32.h | |||
@@ -1,39 +1,7 @@ | |||
1 | #ifndef _I386_PGALLOC_H | 1 | #ifndef _I386_PGALLOC_H |
2 | #define _I386_PGALLOC_H | 2 | #define _I386_PGALLOC_H |
3 | 3 | ||
4 | static inline void pmd_populate_kernel(struct mm_struct *mm, | ||
5 | pmd_t *pmd, pte_t *pte) | ||
6 | { | ||
7 | paravirt_alloc_pt(mm, __pa(pte) >> PAGE_SHIFT); | ||
8 | set_pmd(pmd, __pmd(__pa(pte) | _PAGE_TABLE)); | ||
9 | } | ||
10 | |||
11 | static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *pte) | ||
12 | { | ||
13 | unsigned long pfn = page_to_pfn(pte); | ||
14 | |||
15 | paravirt_alloc_pt(mm, pfn); | ||
16 | set_pmd(pmd, __pmd(((pteval_t)pfn << PAGE_SHIFT) | _PAGE_TABLE)); | ||
17 | } | ||
18 | #define pmd_pgtable(pmd) pmd_page(pmd) | ||
19 | |||
20 | #ifdef CONFIG_X86_PAE | 4 | #ifdef CONFIG_X86_PAE |
21 | /* | ||
22 | * In the PAE case we free the pmds as part of the pgd. | ||
23 | */ | ||
24 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | ||
25 | { | ||
26 | return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); | ||
27 | } | ||
28 | |||
29 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | ||
30 | { | ||
31 | BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); | ||
32 | free_page((unsigned long)pmd); | ||
33 | } | ||
34 | |||
35 | extern void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd); | ||
36 | |||
37 | extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd); | 5 | extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd); |
38 | 6 | ||
39 | #endif /* CONFIG_X86_PAE */ | 7 | #endif /* CONFIG_X86_PAE */ |