]> 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, 2 Nov 2015 11:46:55 +0000 (11:46 +0000)
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
sys/x86/include/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 115310520af0555619941f0917cd1c8708792e86..c3cff89036e23e8885cac203249d38a5d793f8b1 100644 (file)
 /* Everything below this point is not included by assembler (.S) files. */
 #ifndef __ASSEMBLY__
 
+#include <vm/vm.h>
+#include <vm/pmap.h>
+
+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_ */