]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
x86/xen: Add cpu_to_vcpu_id macro
authorJulien Grall <julien.grall@linaro.org>
Sat, 19 Apr 2014 15:57:40 +0000 (16:57 +0100)
committerJulien Grall <julien.grall@linaro.org>
Sun, 12 Apr 2015 11:08:08 +0000 (12:08 +0100)
sys/amd64/include/xen/xen-os.h
sys/i386/include/xen/xen-os.h

index cffc213cd59167d7e9ff9b489553ecaa138a03f1..e4f5ad0d5c5a8c6830d8735567d1346cbf112c33 100644 (file)
@@ -131,6 +131,9 @@ extern start_info_t *xen_start_info;
 
 #define xen_pmap(pa, size)     pmap_mapdev((pa), (size))
 
+#define cpu_to_vcpu_id(cpu) pcpu_find(cpu)->pc_vcpu_id
+
+
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _MACHINE_XEN_XEN_OS_H_ */
index a05d6683ad3a9dbf4a2081151b9e63a32d0e23f0..86d6c9aa5c192bfcf6d48598cc84be9b331bf79d 100644 (file)
@@ -286,6 +286,8 @@ static __inline__ void atomic_inc(atomic_t *v)
 
 #define xen_pmap(pa, size)     pmap_mapdev((pa), (size))
 
+#define cpu_to_vcpu_id(cpu) pcpu_find(cpu)->pc_vcpu_id
+
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _MACHINE_XEN_XEN_OS_H_ */