debuggers.hg

view linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/pgalloc.h @ 3289:a169836882cb

bitkeeper revision 1.1159.170.59 (41b4c2fdJ2gj_BWy27Vj3ptayZp_yg)

sync w/ head.
author cl349@arcadians.cl.cam.ac.uk
date Mon Dec 06 20:37:17 2004 +0000 (2004-12-06)
parents 13728122c78d
children
line source
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 */
9 #include <asm/io.h> /* for phys_to_virt and page_to_pseudophys */
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)
15 {
16 set_pmd(pmd, __pmd(_PAGE_TABLE +
17 ((unsigned long long)page_to_pfn(pte) <<
18 (unsigned long long) PAGE_SHIFT)));
19 flush_page_update_queue();
20 }
21 /*
22 * Allocate and free page tables.
23 */
25 extern pgd_t *pgd_alloc(struct mm_struct *);
26 extern void pgd_free(pgd_t *pgd);
28 extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long);
29 extern struct page *pte_alloc_one(struct mm_struct *, unsigned long);
31 static inline void pte_free_kernel(pte_t *pte)
32 {
33 free_page((unsigned long)pte);
34 make_page_writable(pte);
35 flush_page_update_queue();
36 }
38 extern void pte_free(struct page *pte);
40 #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
42 /*
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.)
46 */
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 */