This commit was manufactured by cvs2svn to create tag
[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/processor.h>
6 #include <asm/fixmap.h>
7 #include <asm/desc.h>
8 #include <linux/threads.h>
9 #include <linux/mm.h>           /* for struct page */
10
11 #define pmd_populate_kernel(mm, pmd, pte) \
12                 set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)))
13
14 static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *pte)
15 {
16         set_pmd(pmd, __pmd(_PAGE_TABLE +
17                 ((unsigned long long)page_to_pfn(pte) <<
18                         (unsigned long long) PAGE_SHIFT)));
19 }
20 /*
21  * Allocate and free page tables.
22  */
23
24 extern pgd_t *pgd_alloc(struct mm_struct *);
25 extern void pgd_free(pgd_t *pgd);
26
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);
29
30 static inline void pte_free_kernel(pte_t *pte)
31 {
32         free_page((unsigned long)pte);
33 }
34
35 static inline void pte_free(struct page *pte)
36 {
37         __free_page(pte);
38 }
39
40
41 #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
42
43 /*
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.)
47  */
48
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()
53
54 #define check_pgt_cache()       do { } while (0)
55
56 #define HAVE_ARCH_UNMAPPED_AREA 1
57
58 #endif /* _I386_PGALLOC_H */