1 #ifndef _ASM_M32R_PGALLOC_H
2 #define _ASM_M32R_PGALLOC_H
6 #include <linux/config.h>
10 #include <asm/pgtable.h>
12 #define pmd_populate_kernel(mm, pmd, pte) \
13 set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)))
15 static __inline__ void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
18 set_pmd(pmd, __pmd(_PAGE_TABLE + page_to_phys(pte)));
22 * Allocate and free page tables.
24 static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm)
26 pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
31 static __inline__ void pgd_free(pgd_t *pgd)
33 free_page((unsigned long)pgd);
36 static __inline__ pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
37 unsigned long address)
39 pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
44 static __inline__ struct page *pte_alloc_one(struct mm_struct *mm,
45 unsigned long address)
47 struct page *pte = alloc_page(GFP_KERNEL|__GFP_ZERO);
53 static __inline__ void pte_free_kernel(pte_t *pte)
55 free_page((unsigned long)pte);
58 static __inline__ void pte_free(struct page *pte)
63 #define __pte_free_tlb(tlb, pte) pte_free((pte))
66 * allocating and freeing a pmd is trivial: the 1-entry pmd is
67 * inside the pgd, so has no extra memory associated with it.
68 * (In the PAE case we free the pmds as part of the pgd.)
71 #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); })
72 #define pmd_free(x) do { } while (0)
73 #define __pmd_free_tlb(tlb, x) do { } while (0)
74 #define pgd_populate(mm, pmd, pte) BUG()
76 #define check_pgt_cache() do { } while (0)
78 #endif /* _ASM_M32R_PGALLOC_H */