perf tools: Be consistent on the type of map->symbols[] interator
[linux/fpc-iii.git] / arch / m32r / include / asm / pgalloc.h
blob2d55a064ccac5ac335e339ce649cf210804842fd
1 #ifndef _ASM_M32R_PGALLOC_H
2 #define _ASM_M32R_PGALLOC_H
4 #include <linux/mm.h>
6 #include <asm/io.h>
8 #define pmd_populate_kernel(mm, pmd, pte) \
9 set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)))
11 static __inline__ void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
12 pgtable_t pte)
14 set_pmd(pmd, __pmd(_PAGE_TABLE + page_to_phys(pte)));
16 #define pmd_pgtable(pmd) pmd_page(pmd)
19 * Allocate and free page tables.
21 static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm)
23 pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
25 return pgd;
28 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
30 free_page((unsigned long)pgd);
33 static __inline__ pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
34 unsigned long address)
36 pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
38 return pte;
41 static __inline__ pgtable_t pte_alloc_one(struct mm_struct *mm,
42 unsigned long address)
44 struct page *pte = alloc_page(GFP_KERNEL|__GFP_ZERO);
46 if (!pte)
47 return NULL;
48 if (!pgtable_page_ctor(pte)) {
49 __free_page(pte);
50 return NULL;
52 return pte;
55 static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
57 free_page((unsigned long)pte);
60 static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
62 pgtable_page_dtor(pte);
63 __free_page(pte);
66 #define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, (pte))
69 * allocating and freeing a pmd is trivial: the 1-entry pmd is
70 * inside the pgd, so has no extra memory associated with it.
71 * (In the PAE case we free the pmds as part of the pgd.)
74 #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); })
75 #define pmd_free(mm, x) do { } while (0)
76 #define __pmd_free_tlb(tlb, x, addr) do { } while (0)
77 #define pgd_populate(mm, pmd, pte) BUG()
79 #define check_pgt_cache() do { } while (0)
81 #endif /* _ASM_M32R_PGALLOC_H */