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
27static inline pgd_t *pgd_alloc(struct mm_struct *mm)
28{
29 return (pgd_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
30}
31
32#if CONFIG_PGTABLE_LEVELS == 4
33static inline void
34p4d_populate(struct mm_struct *mm, p4d_t * p4d_entry, pud_t * pud)
35{
36 p4d_val(*p4d_entry) = __pa(pud);
37}
38
39#define __pud_free_tlb(tlb, pud, address) pud_free((tlb)->mm, pud)
40#endif
41
42static inline void
43pud_populate(struct mm_struct *mm, pud_t * pud_entry, pmd_t * pmd)
44{
45 pud_val(*pud_entry) = __pa(pmd);
46}
47
48#define __pmd_free_tlb(tlb, pmd, address) pmd_free((tlb)->mm, pmd)
49
50static inline void
51pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, pgtable_t pte)
52{
53 pmd_val(*pmd_entry) = page_to_phys(pte);
54}
55
56static inline void
57pmd_populate_kernel(struct mm_struct *mm, pmd_t * pmd_entry, pte_t * pte)
58{
59 pmd_val(*pmd_entry) = __pa(pte);
60}
61
62#define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, pte)
63
64#endif
65