direct-io.hg

view linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/pgalloc.h @ 11509:2e6c10dc7c0b

[POWERPC][XEN] make sure put_domain() is called in case of allocate_rma() failuer

Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Tue Sep 12 10:53:46 2006 -0400 (2006-09-12)
parents fd9b2c1bb577
children 648e58e31c26 3adf00179a63
line source
1 #ifndef _I386_PGALLOC_H
2 #define _I386_PGALLOC_H
4 #include <linux/config.h>
5 #include <asm/fixmap.h>
6 #include <linux/threads.h>
7 #include <linux/mm.h> /* for struct page */
8 #include <asm/io.h> /* for phys_to_virt and page_to_pseudophys */
10 /* Is this pagetable pinned? */
11 #define PG_pinned PG_arch_1
13 #define pmd_populate_kernel(mm, pmd, pte) \
14 set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)))
16 #define pmd_populate(mm, pmd, pte) \
17 do { \
18 if (test_bit(PG_pinned, &virt_to_page((mm)->pgd)->flags)) { \
19 if (!PageHighMem(pte)) \
20 BUG_ON(HYPERVISOR_update_va_mapping( \
21 (unsigned long)__va(page_to_pfn(pte)<<PAGE_SHIFT),\
22 pfn_pte(page_to_pfn(pte), PAGE_KERNEL_RO), 0));\
23 set_pmd(pmd, __pmd(_PAGE_TABLE + \
24 ((unsigned long long)page_to_pfn(pte) << \
25 (unsigned long long) PAGE_SHIFT))); \
26 } else { \
27 *(pmd) = __pmd(_PAGE_TABLE + \
28 ((unsigned long long)page_to_pfn(pte) << \
29 (unsigned long long) PAGE_SHIFT)); \
30 } \
31 } while (0)
33 /*
34 * Allocate and free page tables.
35 */
36 extern pgd_t *pgd_alloc(struct mm_struct *);
37 extern void pgd_free(pgd_t *pgd);
39 extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long);
40 extern struct page *pte_alloc_one(struct mm_struct *, unsigned long);
42 static inline void pte_free_kernel(pte_t *pte)
43 {
44 free_page((unsigned long)pte);
45 make_page_writable(pte, XENFEAT_writable_page_tables);
46 }
48 extern void pte_free(struct page *pte);
50 #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
52 #ifdef CONFIG_X86_PAE
53 /*
54 * In the PAE case we free the pmds as part of the pgd.
55 */
56 #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); })
57 #define pmd_free(x) do { } while (0)
58 #define __pmd_free_tlb(tlb,x) do { } while (0)
59 #define pud_populate(mm, pmd, pte) BUG()
60 #endif
62 #define check_pgt_cache() do { } while (0)
64 #endif /* _I386_PGALLOC_H */