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>
7 #include <linux/threads.h>
8 #include <linux/mm.h> /* for struct page */
10 #define pmd_populate_kernel(mm, pmd, pte) \
11 set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)))
13 static inline void pmd_populate(struct mm_struct
*mm
, pmd_t
*pmd
, struct page
*pte
)
15 set_pmd(pmd
, __pmd(_PAGE_TABLE
+
16 ((unsigned long long)page_to_pfn(pte
) <<
17 (unsigned long long) PAGE_SHIFT
)));
20 * Allocate and free page tables.
23 extern pgd_t
*pgd_alloc(struct mm_struct
*);
24 extern void pgd_free(pgd_t
*pgd
);
26 extern pte_t
*pte_alloc_one_kernel(struct mm_struct
*, unsigned long);
27 extern struct page
*pte_alloc_one(struct mm_struct
*, unsigned long);
29 static inline void pte_free_kernel(pte_t
*pte
)
31 free_page((unsigned long)pte
);
34 static inline void pte_free(struct page
*pte
)
40 #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
43 * allocating and freeing a pmd is trivial: the 1-entry pmd is
44 * inside the pgd, so has no extra memory associated with it.
45 * (In the PAE case we free the pmds as part of the pgd.)
48 #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); })
49 #define pmd_free(x) do { } while (0)
50 #define __pmd_free_tlb(tlb,x) do { } while (0)
51 #define pgd_populate(mm, pmd, pte) BUG()
53 #define check_pgt_cache() do { } while (0)
55 #endif /* _I386_PGALLOC_H */