1 #ifndef _I386_PGALLOC_H
2 #define _I386_PGALLOC_H
4 #include <linux/config.h>
5 #include <asm/processor.h>
6 #include <asm/fixmap.h>
8 #include <linux/threads.h>
9 #include <linux/mm.h> /* for struct page */
11 #define pmd_populate_kernel(mm, pmd, pte) \
12 set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)))
14 static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *pte)
16 set_pmd(pmd, __pmd(_PAGE_TABLE +
17 ((unsigned long long)page_to_pfn(pte) <<
18 (unsigned long long) PAGE_SHIFT)));
21 * Allocate and free page tables.
24 extern pgd_t *pgd_alloc(struct mm_struct *);
25 extern void pgd_free(pgd_t *pgd);
27 extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long);
28 extern struct page *pte_alloc_one(struct mm_struct *, unsigned long);
30 static inline void pte_free_kernel(pte_t *pte)
32 free_page((unsigned long)pte);
35 static inline void pte_free(struct page *pte)
41 #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
44 * allocating and freeing a pmd is trivial: the 1-entry pmd is
45 * inside the pgd, so has no extra memory associated with it.
46 * (In the PAE case we free the pmds as part of the pgd.)
49 #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); })
50 #define pmd_free(x) do { } while (0)
51 #define __pmd_free_tlb(tlb,x) do { } while (0)
52 #define pgd_populate(mm, pmd, pte) BUG()
54 #define check_pgt_cache() do { } while (0)
56 #endif /* _I386_PGALLOC_H */