From 6529523c566fce0958cb1796a17d90efce72e399 Mon Sep 17 00:00:00 2001 From: Julien Grall Date: Tue, 14 Jan 2014 14:44:08 +0000 Subject: [PATCH] xen: Introduce xen_pmap The function to map xen memory is not the same on every architecture. On ARM, the mappings require to be cacheable and pmap_mapdev doesn't do that. Replace every call of pmap_mapdev in xen code by xen_pmap --- sys/dev/xen/xenstore/xenstore.c | 2 +- sys/x86/include/xen/xen-os.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/dev/xen/xenstore/xenstore.c b/sys/dev/xen/xenstore/xenstore.c index f3df97dbed6b..d8b21b4fdc52 100644 --- a/sys/dev/xen/xenstore/xenstore.c +++ b/sys/dev/xen/xenstore/xenstore.c @@ -1168,7 +1168,7 @@ xs_attach(device_t dev) if (xen_hvm_domain()) { xs.evtchn = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN); xs.gpfn = hvm_get_parameter(HVM_PARAM_STORE_PFN); - xen_store = pmap_mapdev(xs.gpfn * PAGE_SIZE, PAGE_SIZE); + xen_store = xen_pmap(xs.gpfn * PAGE_SIZE, PAGE_SIZE); xs.initialized = true; } else if (xen_pv_domain()) { if (HYPERVISOR_start_info->store_evtchn == 0) { diff --git a/sys/x86/include/xen/xen-os.h b/sys/x86/include/xen/xen-os.h index 115310520af0..c3cff89036e2 100644 --- a/sys/x86/include/xen/xen-os.h +++ b/sys/x86/include/xen/xen-os.h @@ -33,6 +33,15 @@ /* Everything below this point is not included by assembler (.S) files. */ #ifndef __ASSEMBLY__ +#include +#include + +static inline void * +xen_pmap(vm_paddr_t pa, vm_size_t size) +{ + return (pmap_mapdev(pa, size)); +} + #endif /* !__ASSEMBLY__ */ #endif /* _MACHINE_X86_XEN_XEN_OS_H_ */ -- 2.39.5