aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/pgalloc_64.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/pgalloc_64.h')
-rw-r--r--include/asm-x86/pgalloc_64.h33
1 files changed, 18 insertions, 15 deletions
diff --git a/include/asm-x86/pgalloc_64.h b/include/asm-x86/pgalloc_64.h
index 8d6722320dcc..bcf525f3fbd0 100644
--- a/include/asm-x86/pgalloc_64.h
+++ b/include/asm-x86/pgalloc_64.h
@@ -1,16 +1,24 @@
1#ifndef _X86_64_PGALLOC_H 1#ifndef _X86_64_PGALLOC_H
2#define _X86_64_PGALLOC_H 2#define _X86_64_PGALLOC_H
3 3
4#include <asm/pda.h>
5#include <linux/threads.h> 4#include <linux/threads.h>
6#include <linux/mm.h> 5#include <linux/mm.h>
6#include <asm/pda.h>
7 7
8#define pmd_populate_kernel(mm, pmd, pte) \ 8static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
9 set_pmd(pmd, __pmd(_PAGE_TABLE | __pa(pte))) 9{
10#define pud_populate(mm, pud, pmd) \ 10 set_pmd(pmd, __pmd(_PAGE_TABLE | __pa(pte)));
11 set_pud(pud, __pud(_PAGE_TABLE | __pa(pmd))) 11}
12#define pgd_populate(mm, pgd, pud) \ 12
13 set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(pud))) 13static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
14{
15 set_pud(pud, __pud(_PAGE_TABLE | __pa(pmd)));
16}
17
18static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud)
19{
20 set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(pud)));
21}
14 22
15#define pmd_pgtable(pmd) pmd_page(pmd) 23#define pmd_pgtable(pmd) pmd_page(pmd)
16 24
@@ -121,13 +129,8 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
121 __free_page(pte); 129 __free_page(pte);
122} 130}
123 131
124#define __pte_free_tlb(tlb,pte) \ 132extern void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte);
125do { \ 133extern void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd);
126 pgtable_page_dtor((pte)); \ 134extern void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud);
127 tlb_remove_page((tlb), (pte)); \
128} while (0)
129
130#define __pmd_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x))
131#define __pud_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x))
132 135
133#endif /* _X86_64_PGALLOC_H */ 136#endif /* _X86_64_PGALLOC_H */