summaryrefslogtreecommitdiff
path: root/include/mach/xen.h
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2010-04-08 00:11:26 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2010-04-08 00:24:50 +0200
commit690d2c6a6fd7512dce0761f21a1d18fb49ca1fcb (patch)
treea63bdc1189dca0f3a8b21700305ff4ce8bbb1ae7 /include/mach/xen.h
parent5a27310a308a7ea56b2ce9020c775c0f64c41b79 (diff)
Extend machine addresses to 64bit for PAE
* i386/i386/pcb.c (switch_ktss): Use uint64_t for descriptor type instead of unsigned long long. * i386/i386/seg.h (fill_descriptor): Use uint64_t for descriptor type instead of unsigned long long. Cast result of kv_to_ma() into vm_offset_t before printing. * i386/i386/xen.h (hyp_mmu_update_pte): Use pt_entry_t type instead of unsigned long long, make pte parameter a pt_entry_t too. (hyp_mmu_update_pte): Compute pte address just using pt_entry_t integers. (hyp_high): New macro to fix 32bit right shifting. (hyp_do_update_descriptor): Use pt_entry_t type for machine address instead of unsigned long. Split it in 32bit parts. Use uint64_t for descriptor type instead of unsigned long long. (update_va_mapping): Use pt_entry_t type instead of unsigned long long. Use hyp_high macro. (hyp_invlpg): Use uint64_t for time type instead of unsigned long long. * i386/intel/pmap.c (pmap_bootstrap): Use ptetokv instead of pte_to_pa + phystokv. Cast machine addresses into vm_offset_t before printing. (pmap_set_page_readwrite): Likewise. (pmap_set_page_readonly): Likewise (pmap_set_page_readonly_init): Likewise (pmap_clear_bootstrap_pagetable): Likewise (pmap_destroy): Likewise (pmap_map_mfn): Use pt_entry_t type for machine addresses. Cast machine addresses into vm_offset_t before printing. * i386/intel/pmap.h [PAE] (INTEL_PTE_PFN): Set macro to 0xfffffffffffff000ULL. * include/mach/xen.h [PAE] (pa_to_ma, ma_to_pa): Use pt_entry_t type for machine addresses. [!PAE] (pa_to_ma): Remove cast to vm_offset_t. (mfn_to_kv): Use mfn_to_pfn + ptoa instead of ptoa + ma_to_pa. * xen/xen.c (hyp_invalidate_pte): Cast machine addresses into vm_offset_t before printing.
Diffstat (limited to 'include/mach/xen.h')
-rw-r--r--include/mach/xen.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/mach/xen.h b/include/mach/xen.h
index f954701..f1d9e41 100644
--- a/include/mach/xen.h
+++ b/include/mach/xen.h
@@ -67,12 +67,17 @@ extern unsigned long *mfn_list;
#endif /* MACH_PSEUDO_PHYS */
#define pa_to_mfn(a) (pfn_to_mfn(atop(a)))
+#ifdef PAE
+#define pa_to_ma(a) ({ vm_offset_t __a = (vm_offset_t) (a); (((pt_entry_t) pa_to_mfn(__a)) << PAGE_SHIFT) | (__a & PAGE_MASK); })
+#define ma_to_pa(a) ({ pt_entry_t __a = (pt_entry_t) (a); (mfn_to_pfn(__a >> PAGE_SHIFT) << PAGE_SHIFT) | (__a & PAGE_MASK); })
+#else
#define pa_to_ma(a) ({ vm_offset_t __a = (vm_offset_t) (a); ptoa(pa_to_mfn(__a)) | (__a & PAGE_MASK); })
-#define ma_to_pa(a) ({ vm_offset_t __a = (vm_offset_t) (a); (mfn_to_pfn(atop((vm_offset_t)(__a))) << PAGE_SHIFT) | (__a & PAGE_MASK); })
+#define ma_to_pa(a) ({ vm_offset_t __a = (vm_offset_t) (a); (mfn_to_pfn(atop((__a))) << PAGE_SHIFT) | (__a & PAGE_MASK); })
+#endif
#define kv_to_mfn(a) pa_to_mfn(_kvtophys(a))
#define kv_to_ma(a) pa_to_ma(_kvtophys(a))
-#define mfn_to_kv(mfn) (phystokv(ma_to_pa(ptoa(mfn))))
+#define mfn_to_kv(mfn) phystokv(ptoa(mfn_to_pfn(mfn)))
#include <machine/xen.h>