]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
xen: Introduce xen_pmap
authorJulien Grall <julien.grall@linaro.org>
Tue, 14 Jan 2014 14:44:08 +0000 (14:44 +0000)
committerJulien Grall <julien.grall@citrix.com>
Mon, 5 Oct 2015 17:54:54 +0000 (18:54 +0100)
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/amd64/include/xen/xen-os.h
sys/dev/xen/xenstore/xenstore.c
sys/i386/include/xen/xen-os.h

index f3b855cc147635426b1126fd9386080f76571c64..8fe5b8d8c822a8fdba37bda84b0b1823752d2526 100644 (file)
@@ -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_ */
index f3df97dbed6b85b3085aaffe55c9bc3d39722664..d8b21b4fdc52a11e4450d25fba8892d2488a2dd3 100644 (file)
@@ -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) {
index e57767d0b8c72ec8e0395855871a82be8876b542..c89a8ee9cb160380201b1473de39baa88d398120 100644 (file)
@@ -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_ */