This commit was generated by cvs2svn to compensate for changes in r925,
[linux-2.6.git] / include / asm-xen / 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 <linux/threads.h>
8 #include <linux/mm.h>           /* for struct page */
9 #include <asm/io.h>             /* for phys_to_virt and page_to_pseudophys */
10
11 #define pmd_populate_kernel(mm, pmd, pte) \
12                 set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)))
13
14 #define pmd_populate(mm, pmd, pte)                              \
15         set_pmd(pmd, __pmd(_PAGE_TABLE +                        \
16                 ((unsigned long long)page_to_pfn(pte) <<        \
17                         (unsigned long long) PAGE_SHIFT)))
18 /*
19  * Allocate and free page tables.
20  */
21 extern pgd_t *pgd_alloc(struct mm_struct *);
22 extern void pgd_free(pgd_t *pgd);
23
24 extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long);
25 extern struct page *pte_alloc_one(struct mm_struct *, unsigned long);
26
27 static inline void pte_free_kernel(pte_t *pte)
28 {
29         free_page((unsigned long)pte);
30         make_page_writable(pte);
31 }
32
33 extern void pte_free(struct page *pte);
34
35 #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
36
37 #ifdef CONFIG_X86_PAE
38 /*
39  * In the PAE case we free the pmds as part of the pgd.
40  */
41 #define pmd_alloc_one(mm, addr)         ({ BUG(); ((pmd_t *)2); })
42 #define pmd_free(x)                     do { } while (0)
43 #define __pmd_free_tlb(tlb,x)           do { } while (0)
44 #define pud_populate(mm, pmd, pte)      BUG()
45 #endif
46
47 #define check_pgt_cache()       do { } while (0)
48
49 /* Exec-Shield dummy macros */
50 extern void arch_add_exec_range(struct mm_struct *mm, unsigned long limit);
51 extern void arch_remove_exec_range(struct mm_struct *mm, unsigned long limit);
52 extern void arch_flush_exec_range(struct mm_struct *mm);
53
54 #endif /* _I386_PGALLOC_H */