From: Julien Grall Date: Tue, 14 Jan 2014 14:44:08 +0000 (+0000) Subject: xen: Introduce xen_pmap X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=839aa46940ea9069cb90ddff7658882bc45b98aa;p=people%2Fjulieng%2Ffreebsd.git 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 --- diff --git a/sys/amd64/include/xen/xen-os.h b/sys/amd64/include/xen/xen-os.h index f3b855cc1476..8fe5b8d8c822 100644 --- a/sys/amd64/include/xen/xen-os.h +++ b/sys/amd64/include/xen/xen-os.h @@ -125,6 +125,8 @@ static __inline__ void clear_bit(int nr, volatile void * addr) extern start_info_t *xen_start_info; +#define xen_pmap(pa, size) pmap_mapdev((pa), (size)) + #endif /* !__ASSEMBLY__ */ #endif /* _MACHINE_XEN_XEN_OS_H_ */ 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/i386/include/xen/xen-os.h b/sys/i386/include/xen/xen-os.h index e57767d0b8c7..c89a8ee9cb16 100644 --- a/sys/i386/include/xen/xen-os.h +++ b/sys/i386/include/xen/xen-os.h @@ -181,6 +181,8 @@ static __inline__ void atomic_inc(atomic_t *v) #define rdtscll(val) \ __asm__ __volatile__("rdtsc" : "=A" (val)) +#define xen_pmap(pa, size) pmap_mapdev((pa), (size)) + #endif /* !__ASSEMBLY__ */ #endif /* _MACHINE_XEN_XEN_OS_H_ */