This source file includes following definitions.
- pgd_alloc
- pgd_free
- pgd_populate
- pud_alloc_one
- pud_free
- pud_populate
- pmd_alloc_one
- pmd_free
- pmd_populate
- pmd_populate_kernel
1
2 #ifndef _ASM_IA64_PGALLOC_H
3 #define _ASM_IA64_PGALLOC_H
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #include <linux/compiler.h>
19 #include <linux/mm.h>
20 #include <linux/page-flags.h>
21 #include <linux/threads.h>
22
23 #include <asm-generic/pgalloc.h>
24
25 #include <asm/mmu_context.h>
26
27 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
28 {
29 return (pgd_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
30 }
31
32 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
33 {
34 free_page((unsigned long)pgd);
35 }
36
37 #if CONFIG_PGTABLE_LEVELS == 4
38 static inline void
39 pgd_populate(struct mm_struct *mm, pgd_t * pgd_entry, pud_t * pud)
40 {
41 pgd_val(*pgd_entry) = __pa(pud);
42 }
43
44 static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
45 {
46 return (pud_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
47 }
48
49 static inline void pud_free(struct mm_struct *mm, pud_t *pud)
50 {
51 free_page((unsigned long)pud);
52 }
53 #define __pud_free_tlb(tlb, pud, address) pud_free((tlb)->mm, pud)
54 #endif
55
56 static inline void
57 pud_populate(struct mm_struct *mm, pud_t * pud_entry, pmd_t * pmd)
58 {
59 pud_val(*pud_entry) = __pa(pmd);
60 }
61
62 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
63 {
64 return (pmd_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
65 }
66
67 static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
68 {
69 free_page((unsigned long)pmd);
70 }
71
72 #define __pmd_free_tlb(tlb, pmd, address) pmd_free((tlb)->mm, pmd)
73
74 static inline void
75 pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, pgtable_t pte)
76 {
77 pmd_val(*pmd_entry) = page_to_phys(pte);
78 }
79 #define pmd_pgtable(pmd) pmd_page(pmd)
80
81 static inline void
82 pmd_populate_kernel(struct mm_struct *mm, pmd_t * pmd_entry, pte_t * pte)
83 {
84 pmd_val(*pmd_entry) = __pa(pte);
85 }
86
87 #define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, pte)
88
89 #endif