Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / include / asm-i386 / pgalloc.h
1 #ifndef _I386_PGALLOC_H
2 #define _I386_PGALLOC_H
3
4 #include <linux/config.h>
5 #include <asm/fixmap.h>
6 #include <asm/desc.h>
7 #include <linux/threads.h>
8 #include <linux/mm.h>           /* for struct page */
9
10 #define pmd_populate_kernel(mm, pmd, pte) \
11                 set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)))
12
13 #define pmd_populate(mm, pmd, pte)                              \
14         set_pmd(pmd, __pmd(_PAGE_TABLE +                        \
15                 ((unsigned long long)page_to_pfn(pte) <<        \
16                         (unsigned long long) PAGE_SHIFT)))
17 /*
18  * Allocate and free page tables.
19  */
20 extern pgd_t *pgd_alloc(struct mm_struct *);
21 extern void pgd_free(pgd_t *pgd);
22
23 extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long);
24 extern struct page *pte_alloc_one(struct mm_struct *, unsigned long);
25
26 static inline void pte_free_kernel(pte_t *pte)
27 {
28         free_page((unsigned long)pte);
29 }
30
31 static inline void pte_free(struct page *pte)
32 {
33         __free_page(pte);
34 }
35
36
37 #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
38
39 #ifdef CONFIG_X86_PAE
40 /*
41  * In the PAE case we free the pmds as part of the pgd.
42  */
43 #define pmd_alloc_one(mm, addr)         ({ BUG(); ((pmd_t *)2); })
44 #define pmd_free(x)                     do { } while (0)
45 #define __pmd_free_tlb(tlb,x)           do { } while (0)
46 #define pud_populate(mm, pmd, pte)      BUG()
47 #endif
48
49 #define check_pgt_cache()       do { } while (0)
50
51 #endif /* _I386_PGALLOC_H */