Jeremy Fitzhardinge | 3b827c1 | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 1 | #ifndef _XEN_MMU_H |
| 2 | |
| 3 | #include <linux/linkage.h> |
| 4 | #include <asm/page.h> |
| 5 | |
Mark McLoughlin | f643370 | 2008-04-02 15:36:36 +0100 | [diff] [blame] | 6 | enum pt_level { |
| 7 | PT_PGD, |
| 8 | PT_PUD, |
| 9 | PT_PMD, |
| 10 | PT_PTE |
| 11 | }; |
| 12 | |
Jeremy Fitzhardinge | f87e4ca | 2007-07-17 18:37:06 -0700 | [diff] [blame] | 13 | |
Jeremy Fitzhardinge | 3b827c1 | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 14 | void set_pte_mfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags); |
| 15 | |
Jeremy Fitzhardinge | 3b827c1 | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 16 | |
| 17 | void xen_activate_mm(struct mm_struct *prev, struct mm_struct *next); |
| 18 | void xen_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm); |
| 19 | void xen_exit_mmap(struct mm_struct *mm); |
| 20 | |
Jeremy Fitzhardinge | 3843fc2 | 2008-05-09 12:05:57 +0100 | [diff] [blame] | 21 | pteval_t xen_pte_val(pte_t); |
| 22 | pmdval_t xen_pmd_val(pmd_t); |
| 23 | pgdval_t xen_pgd_val(pgd_t); |
Jeremy Fitzhardinge | 3b827c1 | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 24 | |
Jeremy Fitzhardinge | 3843fc2 | 2008-05-09 12:05:57 +0100 | [diff] [blame] | 25 | pte_t xen_make_pte(pteval_t); |
| 26 | pmd_t xen_make_pmd(pmdval_t); |
| 27 | pgd_t xen_make_pgd(pgdval_t); |
Jeremy Fitzhardinge | 3b827c1 | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 28 | |
Jeremy Fitzhardinge | e2426cf | 2008-05-31 01:24:27 +0100 | [diff] [blame] | 29 | void xen_set_pte(pte_t *ptep, pte_t pteval); |
Jeremy Fitzhardinge | 3b827c1 | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 30 | void xen_set_pte_at(struct mm_struct *mm, unsigned long addr, |
| 31 | pte_t *ptep, pte_t pteval); |
Jeremy Fitzhardinge | f6e5873 | 2008-07-08 15:06:38 -0700 | [diff] [blame] | 32 | |
| 33 | #ifdef CONFIG_X86_PAE |
Jeremy Fitzhardinge | 3b827c1 | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 34 | void xen_set_pte_atomic(pte_t *ptep, pte_t pte); |
Jeremy Fitzhardinge | f6e5873 | 2008-07-08 15:06:38 -0700 | [diff] [blame] | 35 | void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep); |
| 36 | void xen_pmd_clear(pmd_t *pmdp); |
| 37 | #endif /* CONFIG_X86_PAE */ |
| 38 | |
Jeremy Fitzhardinge | e2426cf | 2008-05-31 01:24:27 +0100 | [diff] [blame] | 39 | void xen_set_pmd(pmd_t *pmdp, pmd_t pmdval); |
Jeremy Fitzhardinge | 3b827c1 | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 40 | void xen_set_pud(pud_t *ptr, pud_t val); |
Jeremy Fitzhardinge | e2426cf | 2008-05-31 01:24:27 +0100 | [diff] [blame] | 41 | void xen_set_pmd_hyper(pmd_t *pmdp, pmd_t pmdval); |
| 42 | void xen_set_pud_hyper(pud_t *ptr, pud_t val); |
Jeremy Fitzhardinge | f6e5873 | 2008-07-08 15:06:38 -0700 | [diff] [blame] | 43 | |
| 44 | #if PAGETABLE_LEVELS == 4 |
| 45 | pudval_t xen_pud_val(pud_t pud); |
| 46 | pud_t xen_make_pud(pudval_t pudval); |
| 47 | void xen_set_pgd(pgd_t *pgdp, pgd_t pgd); |
| 48 | void xen_set_pgd_hyper(pgd_t *pgdp, pgd_t pgd); |
| 49 | #endif |
Jeremy Fitzhardinge | 3b827c1 | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 50 | |
Jeremy Fitzhardinge | d6182fb | 2008-07-08 15:07:13 -0700 | [diff] [blame] | 51 | pgd_t *xen_get_user_pgd(pgd_t *pgd); |
| 52 | |
Jeremy Fitzhardinge | e57778a | 2008-06-16 04:30:02 -0700 | [diff] [blame] | 53 | pte_t xen_ptep_modify_prot_start(struct mm_struct *mm, unsigned long addr, pte_t *ptep); |
| 54 | void xen_ptep_modify_prot_commit(struct mm_struct *mm, unsigned long addr, |
| 55 | pte_t *ptep, pte_t pte); |
| 56 | |
Jeremy Fitzhardinge | 3b827c1 | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 57 | #endif /* _XEN_MMU_H */ |